1#![doc = "MAVLink python_array_test dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#![allow(clippy::match_single_binding)]
6#[cfg(feature = "arbitrary")]
7use arbitrary::Arbitrary;
8#[allow(unused_imports)]
9use bitflags::{bitflags, Flags};
10#[allow(unused_imports)]
11use mavlink_core::{
12 bytes::Bytes, bytes_mut::BytesMut, types::CharArray, MavlinkVersion, Message, MessageData,
13};
14#[allow(unused_imports)]
15use num_derive::{FromPrimitive, ToPrimitive};
16#[allow(unused_imports)]
17use num_traits::{FromPrimitive, ToPrimitive};
18#[cfg(feature = "serde")]
19use serde::{Deserialize, Serialize};
20#[cfg(feature = "ts")]
21use ts_rs::TS;
22pub const MINOR_MAVLINK_VERSION: u8 = 3u8;
23#[cfg_attr(feature = "ts", derive(TS))]
24#[cfg_attr(feature = "ts", ts(export))]
25#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
26#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27#[cfg_attr(feature = "serde", serde(tag = "type"))]
28#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29#[repr(u32)]
30#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
31pub enum ActuatorConfiguration {
32 #[doc = "Do nothing."]
33 ACTUATOR_CONFIGURATION_NONE = 0,
34 #[doc = "Command the actuator to beep now."]
35 ACTUATOR_CONFIGURATION_BEEP = 1,
36 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
37 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
38 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
39 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
40 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
41 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
42 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
43 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
44}
45impl ActuatorConfiguration {
46 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
47}
48impl Default for ActuatorConfiguration {
49 fn default() -> Self {
50 Self::DEFAULT
51 }
52}
53#[cfg_attr(feature = "ts", derive(TS))]
54#[cfg_attr(feature = "ts", ts(export))]
55#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
56#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
57#[cfg_attr(feature = "serde", serde(tag = "type"))]
58#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
59#[repr(u32)]
60#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
61pub enum ActuatorOutputFunction {
62 #[doc = "No function (disabled)."]
63 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
64 #[doc = "Motor 1"]
65 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
66 #[doc = "Motor 2"]
67 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
68 #[doc = "Motor 3"]
69 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
70 #[doc = "Motor 4"]
71 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
72 #[doc = "Motor 5"]
73 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
74 #[doc = "Motor 6"]
75 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
76 #[doc = "Motor 7"]
77 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
78 #[doc = "Motor 8"]
79 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
80 #[doc = "Motor 9"]
81 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
82 #[doc = "Motor 10"]
83 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
84 #[doc = "Motor 11"]
85 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
86 #[doc = "Motor 12"]
87 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
88 #[doc = "Motor 13"]
89 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
90 #[doc = "Motor 14"]
91 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
92 #[doc = "Motor 15"]
93 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
94 #[doc = "Motor 16"]
95 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
96 #[doc = "Servo 1"]
97 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
98 #[doc = "Servo 2"]
99 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
100 #[doc = "Servo 3"]
101 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
102 #[doc = "Servo 4"]
103 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
104 #[doc = "Servo 5"]
105 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
106 #[doc = "Servo 6"]
107 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
108 #[doc = "Servo 7"]
109 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
110 #[doc = "Servo 8"]
111 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
112 #[doc = "Servo 9"]
113 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
114 #[doc = "Servo 10"]
115 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
116 #[doc = "Servo 11"]
117 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
118 #[doc = "Servo 12"]
119 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
120 #[doc = "Servo 13"]
121 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
122 #[doc = "Servo 14"]
123 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
124 #[doc = "Servo 15"]
125 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
126 #[doc = "Servo 16"]
127 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
128}
129impl ActuatorOutputFunction {
130 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
131}
132impl Default for ActuatorOutputFunction {
133 fn default() -> Self {
134 Self::DEFAULT
135 }
136}
137#[cfg_attr(feature = "ts", derive(TS))]
138#[cfg_attr(feature = "ts", ts(export))]
139#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
140#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
141#[cfg_attr(feature = "serde", serde(tag = "type"))]
142#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
143#[repr(u32)]
144#[doc = "Enumeration of the ADSB altimeter types"]
145pub enum AdsbAltitudeType {
146 #[doc = "Altitude reported from a Baro source using QNH reference"]
147 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
148 #[doc = "Altitude reported from a GNSS source"]
149 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
150}
151impl AdsbAltitudeType {
152 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
153}
154impl Default for AdsbAltitudeType {
155 fn default() -> Self {
156 Self::DEFAULT
157 }
158}
159#[cfg_attr(feature = "ts", derive(TS))]
160#[cfg_attr(feature = "ts", ts(export))]
161#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
162#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
163#[cfg_attr(feature = "serde", serde(tag = "type"))]
164#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
165#[repr(u32)]
166#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
167pub enum AdsbEmitterType {
168 ADSB_EMITTER_TYPE_NO_INFO = 0,
169 ADSB_EMITTER_TYPE_LIGHT = 1,
170 ADSB_EMITTER_TYPE_SMALL = 2,
171 ADSB_EMITTER_TYPE_LARGE = 3,
172 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
173 ADSB_EMITTER_TYPE_HEAVY = 5,
174 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
175 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
176 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
177 ADSB_EMITTER_TYPE_GLIDER = 9,
178 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
179 ADSB_EMITTER_TYPE_PARACHUTE = 11,
180 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
181 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
182 ADSB_EMITTER_TYPE_UAV = 14,
183 ADSB_EMITTER_TYPE_SPACE = 15,
184 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
185 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
186 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
187 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
188}
189impl AdsbEmitterType {
190 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
191}
192impl Default for AdsbEmitterType {
193 fn default() -> Self {
194 Self::DEFAULT
195 }
196}
197bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
198impl AdsbFlags {
199 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
200}
201impl Default for AdsbFlags {
202 fn default() -> Self {
203 Self::DEFAULT
204 }
205}
206bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
207impl AisFlags {
208 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
209}
210impl Default for AisFlags {
211 fn default() -> Self {
212 Self::DEFAULT
213 }
214}
215#[cfg_attr(feature = "ts", derive(TS))]
216#[cfg_attr(feature = "ts", ts(export))]
217#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
218#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
219#[cfg_attr(feature = "serde", serde(tag = "type"))]
220#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
221#[repr(u32)]
222#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
223pub enum AisNavStatus {
224 #[doc = "Under way using engine."]
225 UNDER_WAY = 0,
226 AIS_NAV_ANCHORED = 1,
227 AIS_NAV_UN_COMMANDED = 2,
228 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
229 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
230 AIS_NAV_MOORED = 5,
231 AIS_NAV_AGROUND = 6,
232 AIS_NAV_FISHING = 7,
233 AIS_NAV_SAILING = 8,
234 AIS_NAV_RESERVED_HSC = 9,
235 AIS_NAV_RESERVED_WIG = 10,
236 AIS_NAV_RESERVED_1 = 11,
237 AIS_NAV_RESERVED_2 = 12,
238 AIS_NAV_RESERVED_3 = 13,
239 #[doc = "Search And Rescue Transponder."]
240 AIS_NAV_AIS_SART = 14,
241 #[doc = "Not available (default)."]
242 AIS_NAV_UNKNOWN = 15,
243}
244impl AisNavStatus {
245 pub const DEFAULT: Self = Self::UNDER_WAY;
246}
247impl Default for AisNavStatus {
248 fn default() -> Self {
249 Self::DEFAULT
250 }
251}
252#[cfg_attr(feature = "ts", derive(TS))]
253#[cfg_attr(feature = "ts", ts(export))]
254#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
256#[cfg_attr(feature = "serde", serde(tag = "type"))]
257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
258#[repr(u32)]
259#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
260pub enum AisType {
261 #[doc = "Not available (default)."]
262 AIS_TYPE_UNKNOWN = 0,
263 AIS_TYPE_RESERVED_1 = 1,
264 AIS_TYPE_RESERVED_2 = 2,
265 AIS_TYPE_RESERVED_3 = 3,
266 AIS_TYPE_RESERVED_4 = 4,
267 AIS_TYPE_RESERVED_5 = 5,
268 AIS_TYPE_RESERVED_6 = 6,
269 AIS_TYPE_RESERVED_7 = 7,
270 AIS_TYPE_RESERVED_8 = 8,
271 AIS_TYPE_RESERVED_9 = 9,
272 AIS_TYPE_RESERVED_10 = 10,
273 AIS_TYPE_RESERVED_11 = 11,
274 AIS_TYPE_RESERVED_12 = 12,
275 AIS_TYPE_RESERVED_13 = 13,
276 AIS_TYPE_RESERVED_14 = 14,
277 AIS_TYPE_RESERVED_15 = 15,
278 AIS_TYPE_RESERVED_16 = 16,
279 AIS_TYPE_RESERVED_17 = 17,
280 AIS_TYPE_RESERVED_18 = 18,
281 AIS_TYPE_RESERVED_19 = 19,
282 #[doc = "Wing In Ground effect."]
283 AIS_TYPE_WIG = 20,
284 AIS_TYPE_WIG_HAZARDOUS_A = 21,
285 AIS_TYPE_WIG_HAZARDOUS_B = 22,
286 AIS_TYPE_WIG_HAZARDOUS_C = 23,
287 AIS_TYPE_WIG_HAZARDOUS_D = 24,
288 AIS_TYPE_WIG_RESERVED_1 = 25,
289 AIS_TYPE_WIG_RESERVED_2 = 26,
290 AIS_TYPE_WIG_RESERVED_3 = 27,
291 AIS_TYPE_WIG_RESERVED_4 = 28,
292 AIS_TYPE_WIG_RESERVED_5 = 29,
293 AIS_TYPE_FISHING = 30,
294 AIS_TYPE_TOWING = 31,
295 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
296 AIS_TYPE_TOWING_LARGE = 32,
297 #[doc = "Dredging or other underwater ops."]
298 AIS_TYPE_DREDGING = 33,
299 AIS_TYPE_DIVING = 34,
300 AIS_TYPE_MILITARY = 35,
301 AIS_TYPE_SAILING = 36,
302 AIS_TYPE_PLEASURE = 37,
303 AIS_TYPE_RESERVED_20 = 38,
304 AIS_TYPE_RESERVED_21 = 39,
305 #[doc = "High Speed Craft."]
306 AIS_TYPE_HSC = 40,
307 AIS_TYPE_HSC_HAZARDOUS_A = 41,
308 AIS_TYPE_HSC_HAZARDOUS_B = 42,
309 AIS_TYPE_HSC_HAZARDOUS_C = 43,
310 AIS_TYPE_HSC_HAZARDOUS_D = 44,
311 AIS_TYPE_HSC_RESERVED_1 = 45,
312 AIS_TYPE_HSC_RESERVED_2 = 46,
313 AIS_TYPE_HSC_RESERVED_3 = 47,
314 AIS_TYPE_HSC_RESERVED_4 = 48,
315 AIS_TYPE_HSC_UNKNOWN = 49,
316 AIS_TYPE_PILOT = 50,
317 #[doc = "Search And Rescue vessel."]
318 AIS_TYPE_SAR = 51,
319 AIS_TYPE_TUG = 52,
320 AIS_TYPE_PORT_TENDER = 53,
321 #[doc = "Anti-pollution equipment."]
322 AIS_TYPE_ANTI_POLLUTION = 54,
323 AIS_TYPE_LAW_ENFORCEMENT = 55,
324 AIS_TYPE_SPARE_LOCAL_1 = 56,
325 AIS_TYPE_SPARE_LOCAL_2 = 57,
326 AIS_TYPE_MEDICAL_TRANSPORT = 58,
327 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
328 AIS_TYPE_NONECOMBATANT = 59,
329 AIS_TYPE_PASSENGER = 60,
330 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
331 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
332 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
333 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
334 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
335 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
336 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
337 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
338 AIS_TYPE_PASSENGER_UNKNOWN = 69,
339 AIS_TYPE_CARGO = 70,
340 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
341 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
342 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
343 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
344 AIS_TYPE_CARGO_RESERVED_1 = 75,
345 AIS_TYPE_CARGO_RESERVED_2 = 76,
346 AIS_TYPE_CARGO_RESERVED_3 = 77,
347 AIS_TYPE_CARGO_RESERVED_4 = 78,
348 AIS_TYPE_CARGO_UNKNOWN = 79,
349 AIS_TYPE_TANKER = 80,
350 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
351 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
352 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
353 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
354 AIS_TYPE_TANKER_RESERVED_1 = 85,
355 AIS_TYPE_TANKER_RESERVED_2 = 86,
356 AIS_TYPE_TANKER_RESERVED_3 = 87,
357 AIS_TYPE_TANKER_RESERVED_4 = 88,
358 AIS_TYPE_TANKER_UNKNOWN = 89,
359 AIS_TYPE_OTHER = 90,
360 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
361 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
362 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
363 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
364 AIS_TYPE_OTHER_RESERVED_1 = 95,
365 AIS_TYPE_OTHER_RESERVED_2 = 96,
366 AIS_TYPE_OTHER_RESERVED_3 = 97,
367 AIS_TYPE_OTHER_RESERVED_4 = 98,
368 AIS_TYPE_OTHER_UNKNOWN = 99,
369}
370impl AisType {
371 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
372}
373impl Default for AisType {
374 fn default() -> Self {
375 Self::DEFAULT
376 }
377}
378bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
379impl AttitudeTargetTypemask {
380 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
381}
382impl Default for AttitudeTargetTypemask {
383 fn default() -> Self {
384 Self::DEFAULT
385 }
386}
387#[cfg_attr(feature = "ts", derive(TS))]
388#[cfg_attr(feature = "ts", ts(export))]
389#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
390#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
391#[cfg_attr(feature = "serde", serde(tag = "type"))]
392#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
393#[repr(u32)]
394#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
395pub enum AutotuneAxis {
396 #[doc = "Autotune roll axis."]
397 AUTOTUNE_AXIS_ROLL = 1,
398 #[doc = "Autotune pitch axis."]
399 AUTOTUNE_AXIS_PITCH = 2,
400 #[doc = "Autotune yaw axis."]
401 AUTOTUNE_AXIS_YAW = 4,
402}
403impl AutotuneAxis {
404 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
405}
406impl Default for AutotuneAxis {
407 fn default() -> Self {
408 Self::DEFAULT
409 }
410}
411bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
412impl CameraCapFlags {
413 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
414}
415impl Default for CameraCapFlags {
416 fn default() -> Self {
417 Self::DEFAULT
418 }
419}
420#[cfg_attr(feature = "ts", derive(TS))]
421#[cfg_attr(feature = "ts", ts(export))]
422#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
423#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
424#[cfg_attr(feature = "serde", serde(tag = "type"))]
425#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
426#[repr(u32)]
427#[doc = "Camera Modes."]
428pub enum CameraMode {
429 #[doc = "Camera is in image/photo capture mode."]
430 CAMERA_MODE_IMAGE = 0,
431 #[doc = "Camera is in video capture mode."]
432 CAMERA_MODE_VIDEO = 1,
433 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
434 CAMERA_MODE_IMAGE_SURVEY = 2,
435}
436impl CameraMode {
437 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
438}
439impl Default for CameraMode {
440 fn default() -> Self {
441 Self::DEFAULT
442 }
443}
444#[cfg_attr(feature = "ts", derive(TS))]
445#[cfg_attr(feature = "ts", ts(export))]
446#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
447#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
448#[cfg_attr(feature = "serde", serde(tag = "type"))]
449#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
450#[repr(u32)]
451#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
452pub enum CameraSource {
453 #[doc = "Default camera source."]
454 CAMERA_SOURCE_DEFAULT = 0,
455 #[doc = "RGB camera source."]
456 CAMERA_SOURCE_RGB = 1,
457 #[doc = "IR camera source."]
458 CAMERA_SOURCE_IR = 2,
459 #[doc = "NDVI camera source."]
460 CAMERA_SOURCE_NDVI = 3,
461}
462impl CameraSource {
463 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
464}
465impl Default for CameraSource {
466 fn default() -> Self {
467 Self::DEFAULT
468 }
469}
470#[cfg_attr(feature = "ts", derive(TS))]
471#[cfg_attr(feature = "ts", ts(export))]
472#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
473#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
474#[cfg_attr(feature = "serde", serde(tag = "type"))]
475#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
476#[repr(u32)]
477#[doc = "Camera tracking modes"]
478pub enum CameraTrackingMode {
479 #[doc = "Not tracking"]
480 CAMERA_TRACKING_MODE_NONE = 0,
481 #[doc = "Target is a point"]
482 CAMERA_TRACKING_MODE_POINT = 1,
483 #[doc = "Target is a rectangle"]
484 CAMERA_TRACKING_MODE_RECTANGLE = 2,
485}
486impl CameraTrackingMode {
487 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
488}
489impl Default for CameraTrackingMode {
490 fn default() -> Self {
491 Self::DEFAULT
492 }
493}
494#[cfg_attr(feature = "ts", derive(TS))]
495#[cfg_attr(feature = "ts", ts(export))]
496#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
497#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
498#[cfg_attr(feature = "serde", serde(tag = "type"))]
499#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
500#[repr(u32)]
501#[doc = "Camera tracking status flags"]
502pub enum CameraTrackingStatusFlags {
503 #[doc = "Camera is not tracking"]
504 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
505 #[doc = "Camera is tracking"]
506 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
507 #[doc = "Camera tracking in error state"]
508 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
509}
510impl CameraTrackingStatusFlags {
511 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
512}
513impl Default for CameraTrackingStatusFlags {
514 fn default() -> Self {
515 Self::DEFAULT
516 }
517}
518bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
519impl CameraTrackingTargetData {
520 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
521}
522impl Default for CameraTrackingTargetData {
523 fn default() -> Self {
524 Self::DEFAULT
525 }
526}
527#[cfg_attr(feature = "ts", derive(TS))]
528#[cfg_attr(feature = "ts", ts(export))]
529#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
530#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
531#[cfg_attr(feature = "serde", serde(tag = "type"))]
532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
533#[repr(u32)]
534#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
535pub enum CameraZoomType {
536 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
537 ZOOM_TYPE_STEP = 0,
538 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
539 ZOOM_TYPE_CONTINUOUS = 1,
540 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
541 ZOOM_TYPE_RANGE = 2,
542 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
543 ZOOM_TYPE_FOCAL_LENGTH = 3,
544 #[doc = "Zoom value as horizontal field of view in degrees."]
545 ZOOM_TYPE_HORIZONTAL_FOV = 4,
546}
547impl CameraZoomType {
548 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
549}
550impl Default for CameraZoomType {
551 fn default() -> Self {
552 Self::DEFAULT
553 }
554}
555#[cfg_attr(feature = "ts", derive(TS))]
556#[cfg_attr(feature = "ts", ts(export))]
557#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
558#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
559#[cfg_attr(feature = "serde", serde(tag = "type"))]
560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
561#[repr(u32)]
562pub enum CanFilterOp {
563 CAN_FILTER_REPLACE = 0,
564 CAN_FILTER_ADD = 1,
565 CAN_FILTER_REMOVE = 2,
566}
567impl CanFilterOp {
568 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
569}
570impl Default for CanFilterOp {
571 fn default() -> Self {
572 Self::DEFAULT
573 }
574}
575#[cfg_attr(feature = "ts", derive(TS))]
576#[cfg_attr(feature = "ts", ts(export))]
577#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
578#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
579#[cfg_attr(feature = "serde", serde(tag = "type"))]
580#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
581#[repr(u32)]
582#[doc = "Possible responses from a CELLULAR_CONFIG message."]
583pub enum CellularConfigResponse {
584 #[doc = "Changes accepted."]
585 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
586 #[doc = "Invalid APN."]
587 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
588 #[doc = "Invalid PIN."]
589 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
590 #[doc = "Changes rejected."]
591 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
592 #[doc = "PUK is required to unblock SIM card."]
593 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
594}
595impl CellularConfigResponse {
596 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
597}
598impl Default for CellularConfigResponse {
599 fn default() -> Self {
600 Self::DEFAULT
601 }
602}
603#[cfg_attr(feature = "ts", derive(TS))]
604#[cfg_attr(feature = "ts", ts(export))]
605#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
606#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
607#[cfg_attr(feature = "serde", serde(tag = "type"))]
608#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
609#[repr(u32)]
610#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
611pub enum CellularNetworkFailedReason {
612 #[doc = "No error"]
613 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
614 #[doc = "Error state is unknown"]
615 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
616 #[doc = "SIM is required for the modem but missing"]
617 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
618 #[doc = "SIM is available, but not usable for connection"]
619 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
620}
621impl CellularNetworkFailedReason {
622 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
623}
624impl Default for CellularNetworkFailedReason {
625 fn default() -> Self {
626 Self::DEFAULT
627 }
628}
629#[cfg_attr(feature = "ts", derive(TS))]
630#[cfg_attr(feature = "ts", ts(export))]
631#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
632#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
633#[cfg_attr(feature = "serde", serde(tag = "type"))]
634#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
635#[repr(u32)]
636#[doc = "Cellular network radio type"]
637pub enum CellularNetworkRadioType {
638 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
639 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
640 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
641 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
642 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
643}
644impl CellularNetworkRadioType {
645 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
646}
647impl Default for CellularNetworkRadioType {
648 fn default() -> Self {
649 Self::DEFAULT
650 }
651}
652#[cfg_attr(feature = "ts", derive(TS))]
653#[cfg_attr(feature = "ts", ts(export))]
654#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
655#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
656#[cfg_attr(feature = "serde", serde(tag = "type"))]
657#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
658#[repr(u32)]
659#[doc = "These flags encode the cellular network status"]
660pub enum CellularStatusFlag {
661 #[doc = "State unknown or not reportable."]
662 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
663 #[doc = "Modem is unusable"]
664 CELLULAR_STATUS_FLAG_FAILED = 1,
665 #[doc = "Modem is being initialized"]
666 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
667 #[doc = "Modem is locked"]
668 CELLULAR_STATUS_FLAG_LOCKED = 3,
669 #[doc = "Modem is not enabled and is powered down"]
670 CELLULAR_STATUS_FLAG_DISABLED = 4,
671 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
672 CELLULAR_STATUS_FLAG_DISABLING = 5,
673 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
674 CELLULAR_STATUS_FLAG_ENABLING = 6,
675 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
676 CELLULAR_STATUS_FLAG_ENABLED = 7,
677 #[doc = "Modem is searching for a network provider to register"]
678 CELLULAR_STATUS_FLAG_SEARCHING = 8,
679 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
680 CELLULAR_STATUS_FLAG_REGISTERED = 9,
681 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
682 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
683 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
684 CELLULAR_STATUS_FLAG_CONNECTING = 11,
685 #[doc = "One or more packet data bearers is active and connected"]
686 CELLULAR_STATUS_FLAG_CONNECTED = 12,
687}
688impl CellularStatusFlag {
689 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
690}
691impl Default for CellularStatusFlag {
692 fn default() -> Self {
693 Self::DEFAULT
694 }
695}
696#[cfg_attr(feature = "ts", derive(TS))]
697#[cfg_attr(feature = "ts", ts(export))]
698#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
699#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
700#[cfg_attr(feature = "serde", serde(tag = "type"))]
701#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
702#[repr(u32)]
703#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
704pub enum CompMetadataType {
705 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
706 COMP_METADATA_TYPE_GENERAL = 0,
707 #[doc = "Parameter meta data."]
708 COMP_METADATA_TYPE_PARAMETER = 1,
709 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
710 COMP_METADATA_TYPE_COMMANDS = 2,
711 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
712 COMP_METADATA_TYPE_PERIPHERALS = 3,
713 #[doc = "Meta data for the events interface."]
714 COMP_METADATA_TYPE_EVENTS = 4,
715 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
716 COMP_METADATA_TYPE_ACTUATORS = 5,
717}
718impl CompMetadataType {
719 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
720}
721impl Default for CompMetadataType {
722 fn default() -> Self {
723 Self::DEFAULT
724 }
725}
726#[cfg_attr(feature = "ts", derive(TS))]
727#[cfg_attr(feature = "ts", ts(export))]
728#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
729#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
730#[cfg_attr(feature = "serde", serde(tag = "type"))]
731#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
732#[repr(u32)]
733#[doc = "Indicates the ESC connection type."]
734pub enum EscConnectionType {
735 #[doc = "Traditional PPM ESC."]
736 ESC_CONNECTION_TYPE_PPM = 0,
737 #[doc = "Serial Bus connected ESC."]
738 ESC_CONNECTION_TYPE_SERIAL = 1,
739 #[doc = "One Shot PPM ESC."]
740 ESC_CONNECTION_TYPE_ONESHOT = 2,
741 #[doc = "I2C ESC."]
742 ESC_CONNECTION_TYPE_I2C = 3,
743 #[doc = "CAN-Bus ESC."]
744 ESC_CONNECTION_TYPE_CAN = 4,
745 #[doc = "DShot ESC."]
746 ESC_CONNECTION_TYPE_DSHOT = 5,
747}
748impl EscConnectionType {
749 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
750}
751impl Default for EscConnectionType {
752 fn default() -> Self {
753 Self::DEFAULT
754 }
755}
756bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
757impl EscFailureFlags {
758 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
759}
760impl Default for EscFailureFlags {
761 fn default() -> Self {
762 Self::DEFAULT
763 }
764}
765bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
766impl EstimatorStatusFlags {
767 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
768}
769impl Default for EstimatorStatusFlags {
770 fn default() -> Self {
771 Self::DEFAULT
772 }
773}
774#[cfg_attr(feature = "ts", derive(TS))]
775#[cfg_attr(feature = "ts", ts(export))]
776#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
777#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
778#[cfg_attr(feature = "serde", serde(tag = "type"))]
779#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
780#[repr(u32)]
781#[doc = "List of possible failure type to inject."]
782pub enum FailureType {
783 #[doc = "No failure injected, used to reset a previous failure."]
784 FAILURE_TYPE_OK = 0,
785 #[doc = "Sets unit off, so completely non-responsive."]
786 FAILURE_TYPE_OFF = 1,
787 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
788 FAILURE_TYPE_STUCK = 2,
789 #[doc = "Unit is reporting complete garbage."]
790 FAILURE_TYPE_GARBAGE = 3,
791 #[doc = "Unit is consistently wrong."]
792 FAILURE_TYPE_WRONG = 4,
793 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
794 FAILURE_TYPE_SLOW = 5,
795 #[doc = "Data of unit is delayed in time."]
796 FAILURE_TYPE_DELAYED = 6,
797 #[doc = "Unit is sometimes working, sometimes not."]
798 FAILURE_TYPE_INTERMITTENT = 7,
799}
800impl FailureType {
801 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
802}
803impl Default for FailureType {
804 fn default() -> Self {
805 Self::DEFAULT
806 }
807}
808#[cfg_attr(feature = "ts", derive(TS))]
809#[cfg_attr(feature = "ts", ts(export))]
810#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
812#[cfg_attr(feature = "serde", serde(tag = "type"))]
813#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
814#[repr(u32)]
815#[doc = "List of possible units where failures can be injected."]
816pub enum FailureUnit {
817 FAILURE_UNIT_SENSOR_GYRO = 0,
818 FAILURE_UNIT_SENSOR_ACCEL = 1,
819 FAILURE_UNIT_SENSOR_MAG = 2,
820 FAILURE_UNIT_SENSOR_BARO = 3,
821 FAILURE_UNIT_SENSOR_GPS = 4,
822 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
823 FAILURE_UNIT_SENSOR_VIO = 6,
824 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
825 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
826 FAILURE_UNIT_SYSTEM_BATTERY = 100,
827 FAILURE_UNIT_SYSTEM_MOTOR = 101,
828 FAILURE_UNIT_SYSTEM_SERVO = 102,
829 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
830 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
831 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
832}
833impl FailureUnit {
834 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
835}
836impl Default for FailureUnit {
837 fn default() -> Self {
838 Self::DEFAULT
839 }
840}
841#[cfg_attr(feature = "ts", derive(TS))]
842#[cfg_attr(feature = "ts", ts(export))]
843#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
844#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
845#[cfg_attr(feature = "serde", serde(tag = "type"))]
846#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
847#[repr(u32)]
848pub enum FenceBreach {
849 #[doc = "No last fence breach"]
850 FENCE_BREACH_NONE = 0,
851 #[doc = "Breached minimum altitude"]
852 FENCE_BREACH_MINALT = 1,
853 #[doc = "Breached maximum altitude"]
854 FENCE_BREACH_MAXALT = 2,
855 #[doc = "Breached fence boundary"]
856 FENCE_BREACH_BOUNDARY = 3,
857}
858impl FenceBreach {
859 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
860}
861impl Default for FenceBreach {
862 fn default() -> Self {
863 Self::DEFAULT
864 }
865}
866#[cfg_attr(feature = "ts", derive(TS))]
867#[cfg_attr(feature = "ts", ts(export))]
868#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
869#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
870#[cfg_attr(feature = "serde", serde(tag = "type"))]
871#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
872#[repr(u32)]
873#[doc = "Actions being taken to mitigate/prevent fence breach"]
874pub enum FenceMitigate {
875 #[doc = "Unknown"]
876 FENCE_MITIGATE_UNKNOWN = 0,
877 #[doc = "No actions being taken"]
878 FENCE_MITIGATE_NONE = 1,
879 #[doc = "Velocity limiting active to prevent breach"]
880 FENCE_MITIGATE_VEL_LIMIT = 2,
881}
882impl FenceMitigate {
883 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
884}
885impl Default for FenceMitigate {
886 fn default() -> Self {
887 Self::DEFAULT
888 }
889}
890#[cfg_attr(feature = "ts", derive(TS))]
891#[cfg_attr(feature = "ts", ts(export))]
892#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
893#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
894#[cfg_attr(feature = "serde", serde(tag = "type"))]
895#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
896#[repr(u32)]
897#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
898pub enum FenceType {
899 #[doc = "Maximum altitude fence"]
900 FENCE_TYPE_ALT_MAX = 1,
901 #[doc = "Circle fence"]
902 FENCE_TYPE_CIRCLE = 2,
903 #[doc = "Polygon fence"]
904 FENCE_TYPE_POLYGON = 4,
905 #[doc = "Minimum altitude fence"]
906 FENCE_TYPE_ALT_MIN = 8,
907}
908impl FenceType {
909 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
910}
911impl Default for FenceType {
912 fn default() -> Self {
913 Self::DEFAULT
914 }
915}
916#[cfg_attr(feature = "ts", derive(TS))]
917#[cfg_attr(feature = "ts", ts(export))]
918#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
920#[cfg_attr(feature = "serde", serde(tag = "type"))]
921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
922#[repr(u32)]
923#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
924pub enum FirmwareVersionType {
925 #[doc = "development release"]
926 FIRMWARE_VERSION_TYPE_DEV = 0,
927 #[doc = "alpha release"]
928 FIRMWARE_VERSION_TYPE_ALPHA = 64,
929 #[doc = "beta release"]
930 FIRMWARE_VERSION_TYPE_BETA = 128,
931 #[doc = "release candidate"]
932 FIRMWARE_VERSION_TYPE_RC = 192,
933 #[doc = "official stable release"]
934 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
935}
936impl FirmwareVersionType {
937 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
938}
939impl Default for FirmwareVersionType {
940 fn default() -> Self {
941 Self::DEFAULT
942 }
943}
944bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
945impl GimbalDeviceCapFlags {
946 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
947}
948impl Default for GimbalDeviceCapFlags {
949 fn default() -> Self {
950 Self::DEFAULT
951 }
952}
953bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
954impl GimbalDeviceErrorFlags {
955 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
956}
957impl Default for GimbalDeviceErrorFlags {
958 fn default() -> Self {
959 Self::DEFAULT
960 }
961}
962bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
963impl GimbalDeviceFlags {
964 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
965}
966impl Default for GimbalDeviceFlags {
967 fn default() -> Self {
968 Self::DEFAULT
969 }
970}
971bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
972impl GimbalManagerCapFlags {
973 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
974}
975impl Default for GimbalManagerCapFlags {
976 fn default() -> Self {
977 Self::DEFAULT
978 }
979}
980bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
981impl GimbalManagerFlags {
982 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
983}
984impl Default for GimbalManagerFlags {
985 fn default() -> Self {
986 Self::DEFAULT
987 }
988}
989#[cfg_attr(feature = "ts", derive(TS))]
990#[cfg_attr(feature = "ts", ts(export))]
991#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
992#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
993#[cfg_attr(feature = "serde", serde(tag = "type"))]
994#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
995#[repr(u32)]
996#[doc = "Type of GPS fix"]
997pub enum GpsFixType {
998 #[doc = "No GPS connected"]
999 GPS_FIX_TYPE_NO_GPS = 0,
1000 #[doc = "No position information, GPS is connected"]
1001 GPS_FIX_TYPE_NO_FIX = 1,
1002 #[doc = "2D position"]
1003 GPS_FIX_TYPE_2D_FIX = 2,
1004 #[doc = "3D position"]
1005 GPS_FIX_TYPE_3D_FIX = 3,
1006 #[doc = "DGPS/SBAS aided 3D position"]
1007 GPS_FIX_TYPE_DGPS = 4,
1008 #[doc = "RTK float, 3D position"]
1009 GPS_FIX_TYPE_RTK_FLOAT = 5,
1010 #[doc = "RTK Fixed, 3D position"]
1011 GPS_FIX_TYPE_RTK_FIXED = 6,
1012 #[doc = "Static fixed, typically used for base stations"]
1013 GPS_FIX_TYPE_STATIC = 7,
1014 #[doc = "PPP, 3D position."]
1015 GPS_FIX_TYPE_PPP = 8,
1016}
1017impl GpsFixType {
1018 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
1019}
1020impl Default for GpsFixType {
1021 fn default() -> Self {
1022 Self::DEFAULT
1023 }
1024}
1025bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
1026impl GpsInputIgnoreFlags {
1027 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
1028}
1029impl Default for GpsInputIgnoreFlags {
1030 fn default() -> Self {
1031 Self::DEFAULT
1032 }
1033}
1034#[cfg_attr(feature = "ts", derive(TS))]
1035#[cfg_attr(feature = "ts", ts(export))]
1036#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1037#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1038#[cfg_attr(feature = "serde", serde(tag = "type"))]
1039#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1040#[repr(u32)]
1041#[doc = "Gripper actions."]
1042pub enum GripperActions {
1043 #[doc = "Gripper release cargo."]
1044 GRIPPER_ACTION_RELEASE = 0,
1045 #[doc = "Gripper grab onto cargo."]
1046 GRIPPER_ACTION_GRAB = 1,
1047}
1048impl GripperActions {
1049 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
1050}
1051impl Default for GripperActions {
1052 fn default() -> Self {
1053 Self::DEFAULT
1054 }
1055}
1056bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1057impl HighresImuUpdatedFlags {
1058 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1059}
1060impl Default for HighresImuUpdatedFlags {
1061 fn default() -> Self {
1062 Self::DEFAULT
1063 }
1064}
1065bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1066impl HilActuatorControlsFlags {
1067 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1068}
1069impl Default for HilActuatorControlsFlags {
1070 fn default() -> Self {
1071 Self::DEFAULT
1072 }
1073}
1074bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1075impl HilSensorUpdatedFlags {
1076 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1077}
1078impl Default for HilSensorUpdatedFlags {
1079 fn default() -> Self {
1080 Self::DEFAULT
1081 }
1082}
1083bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1084impl HlFailureFlag {
1085 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1086}
1087impl Default for HlFailureFlag {
1088 fn default() -> Self {
1089 Self::DEFAULT
1090 }
1091}
1092bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1093impl IlluminatorErrorFlags {
1094 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1095}
1096impl Default for IlluminatorErrorFlags {
1097 fn default() -> Self {
1098 Self::DEFAULT
1099 }
1100}
1101#[cfg_attr(feature = "ts", derive(TS))]
1102#[cfg_attr(feature = "ts", ts(export))]
1103#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1104#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1105#[cfg_attr(feature = "serde", serde(tag = "type"))]
1106#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1107#[repr(u32)]
1108#[doc = "Modes of illuminator"]
1109pub enum IlluminatorMode {
1110 #[doc = "Illuminator mode is not specified/unknown"]
1111 ILLUMINATOR_MODE_UNKNOWN = 0,
1112 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1113 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1114 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1115 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1116}
1117impl IlluminatorMode {
1118 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1119}
1120impl Default for IlluminatorMode {
1121 fn default() -> Self {
1122 Self::DEFAULT
1123 }
1124}
1125#[cfg_attr(feature = "ts", derive(TS))]
1126#[cfg_attr(feature = "ts", ts(export))]
1127#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1128#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1129#[cfg_attr(feature = "serde", serde(tag = "type"))]
1130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1131#[repr(u32)]
1132#[doc = "Type of landing target"]
1133pub enum LandingTargetType {
1134 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1135 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1136 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1137 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1138 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1139 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1140 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1141 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1142}
1143impl LandingTargetType {
1144 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1145}
1146impl Default for LandingTargetType {
1147 fn default() -> Self {
1148 Self::DEFAULT
1149 }
1150}
1151#[cfg_attr(feature = "ts", derive(TS))]
1152#[cfg_attr(feature = "ts", ts(export))]
1153#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1155#[cfg_attr(feature = "serde", serde(tag = "type"))]
1156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1157#[repr(u32)]
1158pub enum MagCalStatus {
1159 MAG_CAL_NOT_STARTED = 0,
1160 MAG_CAL_WAITING_TO_START = 1,
1161 MAG_CAL_RUNNING_STEP_ONE = 2,
1162 MAG_CAL_RUNNING_STEP_TWO = 3,
1163 MAG_CAL_SUCCESS = 4,
1164 MAG_CAL_FAILED = 5,
1165 MAG_CAL_BAD_ORIENTATION = 6,
1166 MAG_CAL_BAD_RADIUS = 7,
1167}
1168impl MagCalStatus {
1169 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1170}
1171impl Default for MagCalStatus {
1172 fn default() -> Self {
1173 Self::DEFAULT
1174 }
1175}
1176#[cfg_attr(feature = "ts", derive(TS))]
1177#[cfg_attr(feature = "ts", ts(export))]
1178#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1179#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1180#[cfg_attr(feature = "serde", serde(tag = "type"))]
1181#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1182#[repr(u32)]
1183pub enum MavArmAuthDeniedReason {
1184 #[doc = "Not a specific reason"]
1185 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1186 #[doc = "Authorizer will send the error as string to GCS"]
1187 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1188 #[doc = "At least one waypoint have a invalid value"]
1189 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1190 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1191 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1192 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1193 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1194 #[doc = "Weather is not good to fly"]
1195 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1196}
1197impl MavArmAuthDeniedReason {
1198 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1199}
1200impl Default for MavArmAuthDeniedReason {
1201 fn default() -> Self {
1202 Self::DEFAULT
1203 }
1204}
1205#[cfg_attr(feature = "ts", derive(TS))]
1206#[cfg_attr(feature = "ts", ts(export))]
1207#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1208#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1209#[cfg_attr(feature = "serde", serde(tag = "type"))]
1210#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1211#[repr(u32)]
1212#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1213pub enum MavAutopilot {
1214 #[doc = "Generic autopilot, full support for everything"]
1215 MAV_AUTOPILOT_GENERIC = 0,
1216 #[doc = "Reserved for future use."]
1217 MAV_AUTOPILOT_RESERVED = 1,
1218 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1219 MAV_AUTOPILOT_SLUGS = 2,
1220 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1221 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1222 #[doc = "OpenPilot, <http://openpilot.org>"]
1223 MAV_AUTOPILOT_OPENPILOT = 4,
1224 #[doc = "Generic autopilot only supporting simple waypoints"]
1225 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1226 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1227 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1228 #[doc = "Generic autopilot supporting the full mission command set"]
1229 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1230 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1231 MAV_AUTOPILOT_INVALID = 8,
1232 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1233 MAV_AUTOPILOT_PPZ = 9,
1234 #[doc = "UAV Dev Board"]
1235 MAV_AUTOPILOT_UDB = 10,
1236 #[doc = "FlexiPilot"]
1237 MAV_AUTOPILOT_FP = 11,
1238 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1239 MAV_AUTOPILOT_PX4 = 12,
1240 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1241 MAV_AUTOPILOT_SMACCMPILOT = 13,
1242 #[doc = "AutoQuad -- <http://autoquad.org>"]
1243 MAV_AUTOPILOT_AUTOQUAD = 14,
1244 #[doc = "Armazila -- <http://armazila.com>"]
1245 MAV_AUTOPILOT_ARMAZILA = 15,
1246 #[doc = "Aerob -- <http://aerob.ru>"]
1247 MAV_AUTOPILOT_AEROB = 16,
1248 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1249 MAV_AUTOPILOT_ASLUAV = 17,
1250 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1251 MAV_AUTOPILOT_SMARTAP = 18,
1252 #[doc = "AirRails - <http://uaventure.com>"]
1253 MAV_AUTOPILOT_AIRRAILS = 19,
1254 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1255 MAV_AUTOPILOT_REFLEX = 20,
1256}
1257impl MavAutopilot {
1258 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1259}
1260impl Default for MavAutopilot {
1261 fn default() -> Self {
1262 Self::DEFAULT
1263 }
1264}
1265#[cfg_attr(feature = "ts", derive(TS))]
1266#[cfg_attr(feature = "ts", ts(export))]
1267#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1268#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1269#[cfg_attr(feature = "serde", serde(tag = "type"))]
1270#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1271#[repr(u32)]
1272#[doc = "Enumeration for battery charge states."]
1273pub enum MavBatteryChargeState {
1274 #[doc = "Low battery state is not provided"]
1275 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1276 #[doc = "Battery is not in low state. Normal operation."]
1277 MAV_BATTERY_CHARGE_STATE_OK = 1,
1278 #[doc = "Battery state is low, warn and monitor close."]
1279 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1280 #[doc = "Battery state is critical, return or abort immediately."]
1281 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1282 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1283 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1284 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1285 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1286 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1287 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1288 #[doc = "Battery is charging."]
1289 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1290}
1291impl MavBatteryChargeState {
1292 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1293}
1294impl Default for MavBatteryChargeState {
1295 fn default() -> Self {
1296 Self::DEFAULT
1297 }
1298}
1299bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1300impl MavBatteryFault {
1301 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1302}
1303impl Default for MavBatteryFault {
1304 fn default() -> Self {
1305 Self::DEFAULT
1306 }
1307}
1308#[cfg_attr(feature = "ts", derive(TS))]
1309#[cfg_attr(feature = "ts", ts(export))]
1310#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1312#[cfg_attr(feature = "serde", serde(tag = "type"))]
1313#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1314#[repr(u32)]
1315#[doc = "Enumeration of battery functions"]
1316pub enum MavBatteryFunction {
1317 #[doc = "Battery function is unknown"]
1318 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1319 #[doc = "Battery supports all flight systems"]
1320 MAV_BATTERY_FUNCTION_ALL = 1,
1321 #[doc = "Battery for the propulsion system"]
1322 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1323 #[doc = "Avionics battery"]
1324 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1325 #[doc = "Payload battery"]
1326 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1327}
1328impl MavBatteryFunction {
1329 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1330}
1331impl Default for MavBatteryFunction {
1332 fn default() -> Self {
1333 Self::DEFAULT
1334 }
1335}
1336#[cfg_attr(feature = "ts", derive(TS))]
1337#[cfg_attr(feature = "ts", ts(export))]
1338#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1339#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1340#[cfg_attr(feature = "serde", serde(tag = "type"))]
1341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1342#[repr(u32)]
1343#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1344pub enum MavBatteryMode {
1345 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1346 MAV_BATTERY_MODE_UNKNOWN = 0,
1347 #[doc = "Battery is auto discharging (towards storage level)."]
1348 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1349 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1350 MAV_BATTERY_MODE_HOT_SWAP = 2,
1351}
1352impl MavBatteryMode {
1353 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1354}
1355impl Default for MavBatteryMode {
1356 fn default() -> Self {
1357 Self::DEFAULT
1358 }
1359}
1360#[cfg_attr(feature = "ts", derive(TS))]
1361#[cfg_attr(feature = "ts", ts(export))]
1362#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1363#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1364#[cfg_attr(feature = "serde", serde(tag = "type"))]
1365#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1366#[repr(u32)]
1367#[doc = "Enumeration of battery types"]
1368pub enum MavBatteryType {
1369 #[doc = "Not specified."]
1370 MAV_BATTERY_TYPE_UNKNOWN = 0,
1371 #[doc = "Lithium polymer battery"]
1372 MAV_BATTERY_TYPE_LIPO = 1,
1373 #[doc = "Lithium-iron-phosphate battery"]
1374 MAV_BATTERY_TYPE_LIFE = 2,
1375 #[doc = "Lithium-ION battery"]
1376 MAV_BATTERY_TYPE_LION = 3,
1377 #[doc = "Nickel metal hydride battery"]
1378 MAV_BATTERY_TYPE_NIMH = 4,
1379}
1380impl MavBatteryType {
1381 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1382}
1383impl Default for MavBatteryType {
1384 fn default() -> Self {
1385 Self::DEFAULT
1386 }
1387}
1388#[cfg_attr(feature = "ts", derive(TS))]
1389#[cfg_attr(feature = "ts", ts(export))]
1390#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1391#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1392#[cfg_attr(feature = "serde", serde(tag = "type"))]
1393#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1394#[repr(u32)]
1395#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1396pub enum MavCmd {
1397 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1398 MAV_CMD_NAV_WAYPOINT = 16,
1399 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1400 MAV_CMD_NAV_LOITER_UNLIM = 17,
1401 #[doc = "Loiter around this waypoint for X turns"]
1402 MAV_CMD_NAV_LOITER_TURNS = 18,
1403 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1404 MAV_CMD_NAV_LOITER_TIME = 19,
1405 #[doc = "Return to launch location"]
1406 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1407 #[doc = "Land at location."]
1408 MAV_CMD_NAV_LAND = 21,
1409 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1410 MAV_CMD_NAV_TAKEOFF = 22,
1411 #[doc = "Land at local position (local frame only)"]
1412 MAV_CMD_NAV_LAND_LOCAL = 23,
1413 #[doc = "Takeoff from local position (local frame only)"]
1414 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1415 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1416 MAV_CMD_NAV_FOLLOW = 25,
1417 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1418 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1419 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1420 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1421 #[doc = "Begin following a target"]
1422 MAV_CMD_DO_FOLLOW = 32,
1423 #[doc = "Reposition the MAV after a follow target command has been sent"]
1424 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1425 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1426 MAV_CMD_DO_ORBIT = 34,
1427 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1428 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1429 MAV_CMD_NAV_ROI = 80,
1430 #[doc = "Control autonomous path planning on the MAV."]
1431 MAV_CMD_NAV_PATHPLANNING = 81,
1432 #[doc = "Navigate to waypoint using a spline path."]
1433 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1434 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1435 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1436 #[doc = "Land using VTOL mode"]
1437 MAV_CMD_NAV_VTOL_LAND = 85,
1438 #[doc = "hand control over to an external controller"]
1439 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1440 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1441 MAV_CMD_NAV_DELAY = 93,
1442 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1443 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1444 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1445 MAV_CMD_NAV_LAST = 95,
1446 #[doc = "Delay mission state machine."]
1447 MAV_CMD_CONDITION_DELAY = 112,
1448 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1449 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1450 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1451 MAV_CMD_CONDITION_DISTANCE = 114,
1452 #[doc = "Reach a certain target angle."]
1453 MAV_CMD_CONDITION_YAW = 115,
1454 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1455 MAV_CMD_CONDITION_LAST = 159,
1456 #[doc = "Set system mode."]
1457 MAV_CMD_DO_SET_MODE = 176,
1458 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1459 MAV_CMD_DO_JUMP = 177,
1460 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1461 MAV_CMD_DO_CHANGE_SPEED = 178,
1462 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1463 MAV_CMD_DO_SET_HOME = 179,
1464 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1465 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1466 MAV_CMD_DO_SET_PARAMETER = 180,
1467 #[doc = "Set a relay to a condition."]
1468 MAV_CMD_DO_SET_RELAY = 181,
1469 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1470 MAV_CMD_DO_REPEAT_RELAY = 182,
1471 #[doc = "Set a servo to a desired PWM value."]
1472 MAV_CMD_DO_SET_SERVO = 183,
1473 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1474 MAV_CMD_DO_REPEAT_SERVO = 184,
1475 #[doc = "Terminate flight immediately. Flight termination immediately and irreversibly terminates the current flight, returning the vehicle to ground. The vehicle will ignore RC or other input until it has been power-cycled. Termination may trigger safety measures, including: disabling motors and deployment of parachute on multicopters, and setting flight surfaces to initiate a landing pattern on fixed-wing). On multicopters without a parachute it may trigger a crash landing. Support for this command can be tested using the protocol bit: MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION. Support for this command can also be tested by sending the command with param1=0 (<0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1476 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1477 #[doc = "Change altitude set point."]
1478 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1479 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1480 MAV_CMD_DO_SET_ACTUATOR = 187,
1481 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1482 MAV_CMD_DO_RETURN_PATH_START = 188,
1483 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1484 MAV_CMD_DO_LAND_START = 189,
1485 #[doc = "Mission command to perform a landing from a rally point."]
1486 MAV_CMD_DO_RALLY_LAND = 190,
1487 #[doc = "Mission command to safely abort an autonomous landing."]
1488 MAV_CMD_DO_GO_AROUND = 191,
1489 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1490 MAV_CMD_DO_REPOSITION = 192,
1491 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1492 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1493 #[doc = "Set moving direction to forward or reverse."]
1494 MAV_CMD_DO_SET_REVERSE = 194,
1495 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1496 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1497 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1498 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1499 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1500 MAV_CMD_DO_SET_ROI_NONE = 197,
1501 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1502 MAV_CMD_DO_SET_ROI_SYSID = 198,
1503 #[doc = "Control onboard camera system."]
1504 MAV_CMD_DO_CONTROL_VIDEO = 200,
1505 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1506 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1507 MAV_CMD_DO_SET_ROI = 201,
1508 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1509 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1510 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1511 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1512 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1513 #[doc = "Mission command to configure a camera or antenna mount"]
1514 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1515 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1516 #[doc = "Mission command to control a camera or antenna mount"]
1517 MAV_CMD_DO_MOUNT_CONTROL = 205,
1518 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1519 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1520 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1521 MAV_CMD_DO_FENCE_ENABLE = 207,
1522 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1523 MAV_CMD_DO_PARACHUTE = 208,
1524 #[doc = "Command to perform motor test."]
1525 MAV_CMD_DO_MOTOR_TEST = 209,
1526 #[doc = "Change to/from inverted flight."]
1527 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1528 #[doc = "Mission command to operate a gripper."]
1529 MAV_CMD_DO_GRIPPER = 211,
1530 #[doc = "Enable/disable autotune."]
1531 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1532 #[doc = "Sets a desired vehicle turn angle and speed change."]
1533 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1534 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1535 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1536 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1537 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1538 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1539 #[doc = "set id of master controller"]
1540 MAV_CMD_DO_GUIDED_MASTER = 221,
1541 #[doc = "Set limits for external control"]
1542 MAV_CMD_DO_GUIDED_LIMITS = 222,
1543 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1544 MAV_CMD_DO_ENGINE_CONTROL = 223,
1545 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1546 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1547 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1548 MAV_CMD_DO_LAST = 240,
1549 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1550 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1551 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1552 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1553 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1554 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1555 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1556 MAV_CMD_PREFLIGHT_STORAGE = 245,
1557 #[doc = "Request the reboot or shutdown of system components."]
1558 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1559 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1560 MAV_CMD_OVERRIDE_GOTO = 252,
1561 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1562 MAV_CMD_OBLIQUE_SURVEY = 260,
1563 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1564 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1565 #[doc = "start running a mission"]
1566 MAV_CMD_MISSION_START = 300,
1567 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1568 MAV_CMD_ACTUATOR_TEST = 310,
1569 #[doc = "Actuator configuration command."]
1570 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1571 #[doc = "Arms / Disarms a component"]
1572 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1573 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1574 MAV_CMD_RUN_PREARM_CHECKS = 401,
1575 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1576 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1577 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1578 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1579 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1580 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1581 MAV_CMD_GET_HOME_POSITION = 410,
1582 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1583 MAV_CMD_INJECT_FAILURE = 420,
1584 #[doc = "Starts receiver pairing."]
1585 MAV_CMD_START_RX_PAIR = 500,
1586 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1587 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1588 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1589 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1590 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1591 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1592 MAV_CMD_REQUEST_MESSAGE = 512,
1593 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1594 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1595 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1596 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1597 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1598 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1599 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1600 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1601 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1602 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1603 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1604 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1605 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1606 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1607 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1608 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1609 MAV_CMD_STORAGE_FORMAT = 526,
1610 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1611 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1612 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1613 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1614 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1615 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1616 #[doc = "Reset all camera settings to Factory Default"]
1617 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1618 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1619 MAV_CMD_SET_CAMERA_MODE = 530,
1620 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1621 MAV_CMD_SET_CAMERA_ZOOM = 531,
1622 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1623 MAV_CMD_SET_CAMERA_FOCUS = 532,
1624 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1625 MAV_CMD_SET_STORAGE_USAGE = 533,
1626 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1627 MAV_CMD_SET_CAMERA_SOURCE = 534,
1628 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1629 MAV_CMD_JUMP_TAG = 600,
1630 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1631 MAV_CMD_DO_JUMP_TAG = 601,
1632 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1633 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1634 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1635 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1636 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1637 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1638 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1639 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1640 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1641 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1642 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1643 #[doc = "Enable or disable on-board camera triggering system."]
1644 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1645 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1646 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1647 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1648 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1649 #[doc = "Stops ongoing tracking."]
1650 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1651 #[doc = "Starts video capture (recording)."]
1652 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1653 #[doc = "Stop the current video capture (recording)."]
1654 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1655 #[doc = "Start video streaming"]
1656 MAV_CMD_VIDEO_START_STREAMING = 2502,
1657 #[doc = "Stop the given video stream"]
1658 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1659 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1660 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1661 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1662 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1663 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1664 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1665 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1666 MAV_CMD_LOGGING_START = 2510,
1667 #[doc = "Request to stop streaming log data over MAVLink"]
1668 MAV_CMD_LOGGING_STOP = 2511,
1669 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1670 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1671 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1672 #[doc = "Create a panorama at the current position"]
1673 MAV_CMD_PANORAMA_CREATE = 2800,
1674 #[doc = "Request VTOL transition"]
1675 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1676 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1677 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1678 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1679 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1680 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1681 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1682 #[doc = "Delay mission state machine until gate has been reached."]
1683 MAV_CMD_CONDITION_GATE = 4501,
1684 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1685 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1686 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1687 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1688 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1689 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1690 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1691 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1692 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1693 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1694 #[doc = "Rally point. You can have multiple rally points defined."]
1695 MAV_CMD_NAV_RALLY_POINT = 5100,
1696 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1697 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1698 #[doc = "Change state of safety switch."]
1699 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1700 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1701 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1702 #[deprecated = " (Deprecated since 2021-06)"]
1703 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1704 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1705 #[deprecated = " (Deprecated since 2021-06)"]
1706 #[doc = "Control the payload deployment."]
1707 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1708 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1709 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1710 #[doc = "Command to operate winch."]
1711 MAV_CMD_DO_WINCH = 42600,
1712 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1713 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1714 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1715 MAV_CMD_WAYPOINT_USER_1 = 31000,
1716 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1717 MAV_CMD_WAYPOINT_USER_2 = 31001,
1718 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1719 MAV_CMD_WAYPOINT_USER_3 = 31002,
1720 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1721 MAV_CMD_WAYPOINT_USER_4 = 31003,
1722 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1723 MAV_CMD_WAYPOINT_USER_5 = 31004,
1724 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1725 MAV_CMD_SPATIAL_USER_1 = 31005,
1726 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1727 MAV_CMD_SPATIAL_USER_2 = 31006,
1728 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1729 MAV_CMD_SPATIAL_USER_3 = 31007,
1730 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1731 MAV_CMD_SPATIAL_USER_4 = 31008,
1732 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1733 MAV_CMD_SPATIAL_USER_5 = 31009,
1734 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1735 MAV_CMD_USER_1 = 31010,
1736 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1737 MAV_CMD_USER_2 = 31011,
1738 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1739 MAV_CMD_USER_3 = 31012,
1740 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1741 MAV_CMD_USER_4 = 31013,
1742 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1743 MAV_CMD_USER_5 = 31014,
1744 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1745 MAV_CMD_CAN_FORWARD = 32000,
1746}
1747impl MavCmd {
1748 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1749}
1750impl Default for MavCmd {
1751 fn default() -> Self {
1752 Self::DEFAULT
1753 }
1754}
1755#[cfg_attr(feature = "ts", derive(TS))]
1756#[cfg_attr(feature = "ts", ts(export))]
1757#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1758#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1759#[cfg_attr(feature = "serde", serde(tag = "type"))]
1760#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1761#[repr(u32)]
1762#[doc = "Possible actions an aircraft can take to avoid a collision."]
1763pub enum MavCollisionAction {
1764 #[doc = "Ignore any potential collisions"]
1765 MAV_COLLISION_ACTION_NONE = 0,
1766 #[doc = "Report potential collision"]
1767 MAV_COLLISION_ACTION_REPORT = 1,
1768 #[doc = "Ascend or Descend to avoid threat"]
1769 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1770 #[doc = "Move horizontally to avoid threat"]
1771 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1772 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1773 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1774 #[doc = "Aircraft to fly directly back to its launch point"]
1775 MAV_COLLISION_ACTION_RTL = 5,
1776 #[doc = "Aircraft to stop in place"]
1777 MAV_COLLISION_ACTION_HOVER = 6,
1778}
1779impl MavCollisionAction {
1780 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1781}
1782impl Default for MavCollisionAction {
1783 fn default() -> Self {
1784 Self::DEFAULT
1785 }
1786}
1787#[cfg_attr(feature = "ts", derive(TS))]
1788#[cfg_attr(feature = "ts", ts(export))]
1789#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1790#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1791#[cfg_attr(feature = "serde", serde(tag = "type"))]
1792#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1793#[repr(u32)]
1794#[doc = "Source of information about this collision."]
1795pub enum MavCollisionSrc {
1796 #[doc = "ID field references ADSB_VEHICLE packets"]
1797 MAV_COLLISION_SRC_ADSB = 0,
1798 #[doc = "ID field references MAVLink SRC ID"]
1799 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1800}
1801impl MavCollisionSrc {
1802 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1803}
1804impl Default for MavCollisionSrc {
1805 fn default() -> Self {
1806 Self::DEFAULT
1807 }
1808}
1809#[cfg_attr(feature = "ts", derive(TS))]
1810#[cfg_attr(feature = "ts", ts(export))]
1811#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1812#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1813#[cfg_attr(feature = "serde", serde(tag = "type"))]
1814#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1815#[repr(u32)]
1816#[doc = "Aircraft-rated danger from this threat."]
1817pub enum MavCollisionThreatLevel {
1818 #[doc = "Not a threat"]
1819 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1820 #[doc = "Craft is mildly concerned about this threat"]
1821 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1822 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1823 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1824}
1825impl MavCollisionThreatLevel {
1826 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1827}
1828impl Default for MavCollisionThreatLevel {
1829 fn default() -> Self {
1830 Self::DEFAULT
1831 }
1832}
1833#[cfg_attr(feature = "ts", derive(TS))]
1834#[cfg_attr(feature = "ts", ts(export))]
1835#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1836#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1837#[cfg_attr(feature = "serde", serde(tag = "type"))]
1838#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1839#[repr(u32)]
1840#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1841pub enum MavComponent {
1842 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1843 MAV_COMP_ID_ALL = 0,
1844 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1845 MAV_COMP_ID_AUTOPILOT1 = 1,
1846 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1847 MAV_COMP_ID_USER1 = 25,
1848 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1849 MAV_COMP_ID_USER2 = 26,
1850 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1851 MAV_COMP_ID_USER3 = 27,
1852 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1853 MAV_COMP_ID_USER4 = 28,
1854 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1855 MAV_COMP_ID_USER5 = 29,
1856 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1857 MAV_COMP_ID_USER6 = 30,
1858 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1859 MAV_COMP_ID_USER7 = 31,
1860 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1861 MAV_COMP_ID_USER8 = 32,
1862 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1863 MAV_COMP_ID_USER9 = 33,
1864 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1865 MAV_COMP_ID_USER10 = 34,
1866 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1867 MAV_COMP_ID_USER11 = 35,
1868 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1869 MAV_COMP_ID_USER12 = 36,
1870 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1871 MAV_COMP_ID_USER13 = 37,
1872 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1873 MAV_COMP_ID_USER14 = 38,
1874 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1875 MAV_COMP_ID_USER15 = 39,
1876 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1877 MAV_COMP_ID_USER16 = 40,
1878 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1879 MAV_COMP_ID_USER17 = 41,
1880 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1881 MAV_COMP_ID_USER18 = 42,
1882 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1883 MAV_COMP_ID_USER19 = 43,
1884 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1885 MAV_COMP_ID_USER20 = 44,
1886 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1887 MAV_COMP_ID_USER21 = 45,
1888 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1889 MAV_COMP_ID_USER22 = 46,
1890 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1891 MAV_COMP_ID_USER23 = 47,
1892 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1893 MAV_COMP_ID_USER24 = 48,
1894 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1895 MAV_COMP_ID_USER25 = 49,
1896 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1897 MAV_COMP_ID_USER26 = 50,
1898 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1899 MAV_COMP_ID_USER27 = 51,
1900 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1901 MAV_COMP_ID_USER28 = 52,
1902 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1903 MAV_COMP_ID_USER29 = 53,
1904 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1905 MAV_COMP_ID_USER30 = 54,
1906 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1907 MAV_COMP_ID_USER31 = 55,
1908 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1909 MAV_COMP_ID_USER32 = 56,
1910 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1911 MAV_COMP_ID_USER33 = 57,
1912 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1913 MAV_COMP_ID_USER34 = 58,
1914 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1915 MAV_COMP_ID_USER35 = 59,
1916 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1917 MAV_COMP_ID_USER36 = 60,
1918 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1919 MAV_COMP_ID_USER37 = 61,
1920 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1921 MAV_COMP_ID_USER38 = 62,
1922 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1923 MAV_COMP_ID_USER39 = 63,
1924 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1925 MAV_COMP_ID_USER40 = 64,
1926 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1927 MAV_COMP_ID_USER41 = 65,
1928 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1929 MAV_COMP_ID_USER42 = 66,
1930 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1931 MAV_COMP_ID_USER43 = 67,
1932 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1933 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1934 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1935 MAV_COMP_ID_USER45 = 69,
1936 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1937 MAV_COMP_ID_USER46 = 70,
1938 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1939 MAV_COMP_ID_USER47 = 71,
1940 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1941 MAV_COMP_ID_USER48 = 72,
1942 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1943 MAV_COMP_ID_USER49 = 73,
1944 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1945 MAV_COMP_ID_USER50 = 74,
1946 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1947 MAV_COMP_ID_USER51 = 75,
1948 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1949 MAV_COMP_ID_USER52 = 76,
1950 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1951 MAV_COMP_ID_USER53 = 77,
1952 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1953 MAV_COMP_ID_USER54 = 78,
1954 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1955 MAV_COMP_ID_USER55 = 79,
1956 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1957 MAV_COMP_ID_USER56 = 80,
1958 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1959 MAV_COMP_ID_USER57 = 81,
1960 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1961 MAV_COMP_ID_USER58 = 82,
1962 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1963 MAV_COMP_ID_USER59 = 83,
1964 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1965 MAV_COMP_ID_USER60 = 84,
1966 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1967 MAV_COMP_ID_USER61 = 85,
1968 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1969 MAV_COMP_ID_USER62 = 86,
1970 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1971 MAV_COMP_ID_USER63 = 87,
1972 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1973 MAV_COMP_ID_USER64 = 88,
1974 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1975 MAV_COMP_ID_USER65 = 89,
1976 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1977 MAV_COMP_ID_USER66 = 90,
1978 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1979 MAV_COMP_ID_USER67 = 91,
1980 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1981 MAV_COMP_ID_USER68 = 92,
1982 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1983 MAV_COMP_ID_USER69 = 93,
1984 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1985 MAV_COMP_ID_USER70 = 94,
1986 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1987 MAV_COMP_ID_USER71 = 95,
1988 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1989 MAV_COMP_ID_USER72 = 96,
1990 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1991 MAV_COMP_ID_USER73 = 97,
1992 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1993 MAV_COMP_ID_USER74 = 98,
1994 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1995 MAV_COMP_ID_USER75 = 99,
1996 #[doc = "Camera #1."]
1997 MAV_COMP_ID_CAMERA = 100,
1998 #[doc = "Camera #2."]
1999 MAV_COMP_ID_CAMERA2 = 101,
2000 #[doc = "Camera #3."]
2001 MAV_COMP_ID_CAMERA3 = 102,
2002 #[doc = "Camera #4."]
2003 MAV_COMP_ID_CAMERA4 = 103,
2004 #[doc = "Camera #5."]
2005 MAV_COMP_ID_CAMERA5 = 104,
2006 #[doc = "Camera #6."]
2007 MAV_COMP_ID_CAMERA6 = 105,
2008 #[doc = "Servo #1."]
2009 MAV_COMP_ID_SERVO1 = 140,
2010 #[doc = "Servo #2."]
2011 MAV_COMP_ID_SERVO2 = 141,
2012 #[doc = "Servo #3."]
2013 MAV_COMP_ID_SERVO3 = 142,
2014 #[doc = "Servo #4."]
2015 MAV_COMP_ID_SERVO4 = 143,
2016 #[doc = "Servo #5."]
2017 MAV_COMP_ID_SERVO5 = 144,
2018 #[doc = "Servo #6."]
2019 MAV_COMP_ID_SERVO6 = 145,
2020 #[doc = "Servo #7."]
2021 MAV_COMP_ID_SERVO7 = 146,
2022 #[doc = "Servo #8."]
2023 MAV_COMP_ID_SERVO8 = 147,
2024 #[doc = "Servo #9."]
2025 MAV_COMP_ID_SERVO9 = 148,
2026 #[doc = "Servo #10."]
2027 MAV_COMP_ID_SERVO10 = 149,
2028 #[doc = "Servo #11."]
2029 MAV_COMP_ID_SERVO11 = 150,
2030 #[doc = "Servo #12."]
2031 MAV_COMP_ID_SERVO12 = 151,
2032 #[doc = "Servo #13."]
2033 MAV_COMP_ID_SERVO13 = 152,
2034 #[doc = "Servo #14."]
2035 MAV_COMP_ID_SERVO14 = 153,
2036 #[doc = "Gimbal #1."]
2037 MAV_COMP_ID_GIMBAL = 154,
2038 #[doc = "Logging component."]
2039 MAV_COMP_ID_LOG = 155,
2040 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
2041 MAV_COMP_ID_ADSB = 156,
2042 #[doc = "On Screen Display (OSD) devices for video links."]
2043 MAV_COMP_ID_OSD = 157,
2044 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
2045 MAV_COMP_ID_PERIPHERAL = 158,
2046 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
2047 #[doc = "Gimbal ID for QX1."]
2048 MAV_COMP_ID_QX1_GIMBAL = 159,
2049 #[doc = "FLARM collision alert component."]
2050 MAV_COMP_ID_FLARM = 160,
2051 #[doc = "Parachute component."]
2052 MAV_COMP_ID_PARACHUTE = 161,
2053 #[doc = "Winch component."]
2054 MAV_COMP_ID_WINCH = 169,
2055 #[doc = "Gimbal #2."]
2056 MAV_COMP_ID_GIMBAL2 = 171,
2057 #[doc = "Gimbal #3."]
2058 MAV_COMP_ID_GIMBAL3 = 172,
2059 #[doc = "Gimbal #4"]
2060 MAV_COMP_ID_GIMBAL4 = 173,
2061 #[doc = "Gimbal #5."]
2062 MAV_COMP_ID_GIMBAL5 = 174,
2063 #[doc = "Gimbal #6."]
2064 MAV_COMP_ID_GIMBAL6 = 175,
2065 #[doc = "Battery #1."]
2066 MAV_COMP_ID_BATTERY = 180,
2067 #[doc = "Battery #2."]
2068 MAV_COMP_ID_BATTERY2 = 181,
2069 #[doc = "CAN over MAVLink client."]
2070 MAV_COMP_ID_MAVCAN = 189,
2071 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
2072 MAV_COMP_ID_MISSIONPLANNER = 190,
2073 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2074 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
2075 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2076 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
2077 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2078 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
2079 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2080 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
2081 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
2082 MAV_COMP_ID_PATHPLANNER = 195,
2083 #[doc = "Component that plans a collision free path between two points."]
2084 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2085 #[doc = "Component that provides position estimates using VIO techniques."]
2086 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2087 #[doc = "Component that manages pairing of vehicle and GCS."]
2088 MAV_COMP_ID_PAIRING_MANAGER = 198,
2089 #[doc = "Inertial Measurement Unit (IMU) #1."]
2090 MAV_COMP_ID_IMU = 200,
2091 #[doc = "Inertial Measurement Unit (IMU) #2."]
2092 MAV_COMP_ID_IMU_2 = 201,
2093 #[doc = "Inertial Measurement Unit (IMU) #3."]
2094 MAV_COMP_ID_IMU_3 = 202,
2095 #[doc = "GPS #1."]
2096 MAV_COMP_ID_GPS = 220,
2097 #[doc = "GPS #2."]
2098 MAV_COMP_ID_GPS2 = 221,
2099 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2100 MAV_COMP_ID_ODID_TXRX_1 = 236,
2101 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2102 MAV_COMP_ID_ODID_TXRX_2 = 237,
2103 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2104 MAV_COMP_ID_ODID_TXRX_3 = 238,
2105 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2106 MAV_COMP_ID_UDP_BRIDGE = 240,
2107 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2108 MAV_COMP_ID_UART_BRIDGE = 241,
2109 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2110 MAV_COMP_ID_TUNNEL_NODE = 242,
2111 #[doc = "Illuminator"]
2112 MAV_COMP_ID_ILLUMINATOR = 243,
2113 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2114 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2115 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2116}
2117impl MavComponent {
2118 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2119}
2120impl Default for MavComponent {
2121 fn default() -> Self {
2122 Self::DEFAULT
2123 }
2124}
2125#[cfg_attr(feature = "ts", derive(TS))]
2126#[cfg_attr(feature = "ts", ts(export))]
2127#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2128#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2129#[cfg_attr(feature = "serde", serde(tag = "type"))]
2130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2131#[repr(u32)]
2132#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2133#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2134pub enum MavDataStream {
2135 #[doc = "Enable all data streams"]
2136 MAV_DATA_STREAM_ALL = 0,
2137 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2138 MAV_DATA_STREAM_RAW_SENSORS = 1,
2139 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2140 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2141 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2142 MAV_DATA_STREAM_RC_CHANNELS = 3,
2143 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2144 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2145 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2146 MAV_DATA_STREAM_POSITION = 6,
2147 #[doc = "Dependent on the autopilot"]
2148 MAV_DATA_STREAM_EXTRA1 = 10,
2149 #[doc = "Dependent on the autopilot"]
2150 MAV_DATA_STREAM_EXTRA2 = 11,
2151 #[doc = "Dependent on the autopilot"]
2152 MAV_DATA_STREAM_EXTRA3 = 12,
2153}
2154impl MavDataStream {
2155 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2156}
2157impl Default for MavDataStream {
2158 fn default() -> Self {
2159 Self::DEFAULT
2160 }
2161}
2162#[cfg_attr(feature = "ts", derive(TS))]
2163#[cfg_attr(feature = "ts", ts(export))]
2164#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2165#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2166#[cfg_attr(feature = "serde", serde(tag = "type"))]
2167#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2168#[repr(u32)]
2169#[doc = "Enumeration of distance sensor types"]
2170pub enum MavDistanceSensor {
2171 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2172 MAV_DISTANCE_SENSOR_LASER = 0,
2173 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2174 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2175 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2176 MAV_DISTANCE_SENSOR_INFRARED = 2,
2177 #[doc = "Radar type, e.g. uLanding units"]
2178 MAV_DISTANCE_SENSOR_RADAR = 3,
2179 #[doc = "Broken or unknown type, e.g. analog units"]
2180 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2181}
2182impl MavDistanceSensor {
2183 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2184}
2185impl Default for MavDistanceSensor {
2186 fn default() -> Self {
2187 Self::DEFAULT
2188 }
2189}
2190#[cfg_attr(feature = "ts", derive(TS))]
2191#[cfg_attr(feature = "ts", ts(export))]
2192#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2193#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2194#[cfg_attr(feature = "serde", serde(tag = "type"))]
2195#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2196#[repr(u32)]
2197#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2198pub enum MavDoRepositionFlags {
2199 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2200 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2201}
2202impl MavDoRepositionFlags {
2203 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2204}
2205impl Default for MavDoRepositionFlags {
2206 fn default() -> Self {
2207 Self::DEFAULT
2208 }
2209}
2210#[cfg_attr(feature = "ts", derive(TS))]
2211#[cfg_attr(feature = "ts", ts(export))]
2212#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2213#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2214#[cfg_attr(feature = "serde", serde(tag = "type"))]
2215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2216#[repr(u32)]
2217#[doc = "Enumeration of estimator types"]
2218pub enum MavEstimatorType {
2219 #[doc = "Unknown type of the estimator."]
2220 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2221 #[doc = "This is a naive estimator without any real covariance feedback."]
2222 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2223 #[doc = "Computer vision based estimate. Might be up to scale."]
2224 MAV_ESTIMATOR_TYPE_VISION = 2,
2225 #[doc = "Visual-inertial estimate."]
2226 MAV_ESTIMATOR_TYPE_VIO = 3,
2227 #[doc = "Plain GPS estimate."]
2228 MAV_ESTIMATOR_TYPE_GPS = 4,
2229 #[doc = "Estimator integrating GPS and inertial sensing."]
2230 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2231 #[doc = "Estimate from external motion capturing system."]
2232 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2233 #[doc = "Estimator based on lidar sensor input."]
2234 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2235 #[doc = "Estimator on autopilot."]
2236 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2237}
2238impl MavEstimatorType {
2239 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2240}
2241impl Default for MavEstimatorType {
2242 fn default() -> Self {
2243 Self::DEFAULT
2244 }
2245}
2246#[cfg_attr(feature = "ts", derive(TS))]
2247#[cfg_attr(feature = "ts", ts(export))]
2248#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2249#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2250#[cfg_attr(feature = "serde", serde(tag = "type"))]
2251#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2252#[repr(u32)]
2253#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2254pub enum MavEventCurrentSequenceFlags {
2255 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2256 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2257}
2258impl MavEventCurrentSequenceFlags {
2259 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2260}
2261impl Default for MavEventCurrentSequenceFlags {
2262 fn default() -> Self {
2263 Self::DEFAULT
2264 }
2265}
2266#[cfg_attr(feature = "ts", derive(TS))]
2267#[cfg_attr(feature = "ts", ts(export))]
2268#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2269#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2270#[cfg_attr(feature = "serde", serde(tag = "type"))]
2271#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2272#[repr(u32)]
2273#[doc = "Reason for an event error response."]
2274pub enum MavEventErrorReason {
2275 #[doc = "The requested event is not available (anymore)."]
2276 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2277}
2278impl MavEventErrorReason {
2279 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2280}
2281impl Default for MavEventErrorReason {
2282 fn default() -> Self {
2283 Self::DEFAULT
2284 }
2285}
2286#[cfg_attr(feature = "ts", derive(TS))]
2287#[cfg_attr(feature = "ts", ts(export))]
2288#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2289#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2290#[cfg_attr(feature = "serde", serde(tag = "type"))]
2291#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2292#[repr(u32)]
2293#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2294pub enum MavFrame {
2295 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2296 MAV_FRAME_GLOBAL = 0,
2297 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2298 MAV_FRAME_LOCAL_NED = 1,
2299 #[doc = "NOT a coordinate frame, indicates a mission command."]
2300 MAV_FRAME_MISSION = 2,
2301 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2302 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2303 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2304 MAV_FRAME_LOCAL_ENU = 4,
2305 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2306 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2307 MAV_FRAME_GLOBAL_INT = 5,
2308 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2309 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2310 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2311 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2312 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2313 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2314 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2315 MAV_FRAME_BODY_NED = 8,
2316 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2317 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2318 MAV_FRAME_BODY_OFFSET_NED = 9,
2319 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2320 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2321 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2322 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2323 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2324 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2325 MAV_FRAME_BODY_FRD = 12,
2326 #[deprecated = " (Deprecated since 2019-04)"]
2327 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2328 MAV_FRAME_RESERVED_13 = 13,
2329 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2330 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2331 MAV_FRAME_RESERVED_14 = 14,
2332 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2333 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2334 MAV_FRAME_RESERVED_15 = 15,
2335 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2336 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2337 MAV_FRAME_RESERVED_16 = 16,
2338 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2339 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2340 MAV_FRAME_RESERVED_17 = 17,
2341 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2342 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2343 MAV_FRAME_RESERVED_18 = 18,
2344 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2345 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2346 MAV_FRAME_RESERVED_19 = 19,
2347 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2348 MAV_FRAME_LOCAL_FRD = 20,
2349 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2350 MAV_FRAME_LOCAL_FLU = 21,
2351}
2352impl MavFrame {
2353 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2354}
2355impl Default for MavFrame {
2356 fn default() -> Self {
2357 Self::DEFAULT
2358 }
2359}
2360#[cfg_attr(feature = "ts", derive(TS))]
2361#[cfg_attr(feature = "ts", ts(export))]
2362#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2363#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2364#[cfg_attr(feature = "serde", serde(tag = "type"))]
2365#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2366#[repr(u32)]
2367#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2368pub enum MavFtpErr {
2369 #[doc = "None: No error"]
2370 MAV_FTP_ERR_NONE = 0,
2371 #[doc = "Fail: Unknown failure"]
2372 MAV_FTP_ERR_FAIL = 1,
2373 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2374 MAV_FTP_ERR_FAILERRNO = 2,
2375 #[doc = "InvalidDataSize: Payload size is invalid"]
2376 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2377 #[doc = "InvalidSession: Session is not currently open"]
2378 MAV_FTP_ERR_INVALIDSESSION = 4,
2379 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2380 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2381 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2382 MAV_FTP_ERR_EOF = 6,
2383 #[doc = "UnknownCommand: Unknown command / opcode"]
2384 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2385 #[doc = "FileExists: File/directory already exists"]
2386 MAV_FTP_ERR_FILEEXISTS = 8,
2387 #[doc = "FileProtected: File/directory is write protected"]
2388 MAV_FTP_ERR_FILEPROTECTED = 9,
2389 #[doc = "FileNotFound: File/directory not found"]
2390 MAV_FTP_ERR_FILENOTFOUND = 10,
2391}
2392impl MavFtpErr {
2393 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2394}
2395impl Default for MavFtpErr {
2396 fn default() -> Self {
2397 Self::DEFAULT
2398 }
2399}
2400#[cfg_attr(feature = "ts", derive(TS))]
2401#[cfg_attr(feature = "ts", ts(export))]
2402#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2403#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2404#[cfg_attr(feature = "serde", serde(tag = "type"))]
2405#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2406#[repr(u32)]
2407#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2408pub enum MavFtpOpcode {
2409 #[doc = "None. Ignored, always ACKed"]
2410 MAV_FTP_OPCODE_NONE = 0,
2411 #[doc = "TerminateSession: Terminates open Read session"]
2412 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2413 #[doc = "ResetSessions: Terminates all open read sessions"]
2414 MAV_FTP_OPCODE_RESETSESSION = 2,
2415 #[doc = "ListDirectory. List files and directories in path from offset"]
2416 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2417 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2418 MAV_FTP_OPCODE_OPENFILERO = 4,
2419 #[doc = "ReadFile: Reads size bytes from offset in session"]
2420 MAV_FTP_OPCODE_READFILE = 5,
2421 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2422 MAV_FTP_OPCODE_CREATEFILE = 6,
2423 #[doc = "WriteFile: Writes size bytes to offset in session"]
2424 MAV_FTP_OPCODE_WRITEFILE = 7,
2425 #[doc = "RemoveFile: Remove file at path"]
2426 MAV_FTP_OPCODE_REMOVEFILE = 8,
2427 #[doc = "CreateDirectory: Creates directory at path"]
2428 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2429 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2430 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2431 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2432 MAV_FTP_OPCODE_OPENFILEWO = 11,
2433 #[doc = "TruncateFile: Truncate file at path to offset length"]
2434 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2435 #[doc = "Rename: Rename path1 to path2"]
2436 MAV_FTP_OPCODE_RENAME = 13,
2437 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2438 MAV_FTP_OPCODE_CALCFILECRC = 14,
2439 #[doc = "BurstReadFile: Burst download session file"]
2440 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2441 #[doc = "ACK: ACK response"]
2442 MAV_FTP_OPCODE_ACK = 128,
2443 #[doc = "NAK: NAK response"]
2444 MAV_FTP_OPCODE_NAK = 129,
2445}
2446impl MavFtpOpcode {
2447 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2448}
2449impl Default for MavFtpOpcode {
2450 fn default() -> Self {
2451 Self::DEFAULT
2452 }
2453}
2454#[cfg_attr(feature = "ts", derive(TS))]
2455#[cfg_attr(feature = "ts", ts(export))]
2456#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2457#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2458#[cfg_attr(feature = "serde", serde(tag = "type"))]
2459#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2460#[repr(u32)]
2461#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2462pub enum MavFuelType {
2463 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2464 MAV_FUEL_TYPE_UNKNOWN = 0,
2465 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2466 MAV_FUEL_TYPE_LIQUID = 1,
2467 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2468 MAV_FUEL_TYPE_GAS = 2,
2469}
2470impl MavFuelType {
2471 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2472}
2473impl Default for MavFuelType {
2474 fn default() -> Self {
2475 Self::DEFAULT
2476 }
2477}
2478bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2479impl MavGeneratorStatusFlag {
2480 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2481}
2482impl Default for MavGeneratorStatusFlag {
2483 fn default() -> Self {
2484 Self::DEFAULT
2485 }
2486}
2487#[cfg_attr(feature = "ts", derive(TS))]
2488#[cfg_attr(feature = "ts", ts(export))]
2489#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2490#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2491#[cfg_attr(feature = "serde", serde(tag = "type"))]
2492#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2493#[repr(u32)]
2494#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2495pub enum MavGoto {
2496 #[doc = "Hold at the current position."]
2497 MAV_GOTO_DO_HOLD = 0,
2498 #[doc = "Continue with the next item in mission execution."]
2499 MAV_GOTO_DO_CONTINUE = 1,
2500 #[doc = "Hold at the current position of the system"]
2501 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2502 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2503 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2504}
2505impl MavGoto {
2506 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2507}
2508impl Default for MavGoto {
2509 fn default() -> Self {
2510 Self::DEFAULT
2511 }
2512}
2513#[cfg_attr(feature = "ts", derive(TS))]
2514#[cfg_attr(feature = "ts", ts(export))]
2515#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2516#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2517#[cfg_attr(feature = "serde", serde(tag = "type"))]
2518#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2519#[repr(u32)]
2520#[doc = "Enumeration of landed detector states"]
2521pub enum MavLandedState {
2522 #[doc = "MAV landed state is unknown"]
2523 MAV_LANDED_STATE_UNDEFINED = 0,
2524 #[doc = "MAV is landed (on ground)"]
2525 MAV_LANDED_STATE_ON_GROUND = 1,
2526 #[doc = "MAV is in air"]
2527 MAV_LANDED_STATE_IN_AIR = 2,
2528 #[doc = "MAV currently taking off"]
2529 MAV_LANDED_STATE_TAKEOFF = 3,
2530 #[doc = "MAV currently landing"]
2531 MAV_LANDED_STATE_LANDING = 4,
2532}
2533impl MavLandedState {
2534 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2535}
2536impl Default for MavLandedState {
2537 fn default() -> Self {
2538 Self::DEFAULT
2539 }
2540}
2541#[cfg_attr(feature = "ts", derive(TS))]
2542#[cfg_attr(feature = "ts", ts(export))]
2543#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2544#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2545#[cfg_attr(feature = "serde", serde(tag = "type"))]
2546#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2547#[repr(u32)]
2548#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2549pub enum MavMissionResult {
2550 #[doc = "mission accepted OK"]
2551 MAV_MISSION_ACCEPTED = 0,
2552 #[doc = "Generic error / not accepting mission commands at all right now."]
2553 MAV_MISSION_ERROR = 1,
2554 #[doc = "Coordinate frame is not supported."]
2555 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2556 #[doc = "Command is not supported."]
2557 MAV_MISSION_UNSUPPORTED = 3,
2558 #[doc = "Mission items exceed storage space."]
2559 MAV_MISSION_NO_SPACE = 4,
2560 #[doc = "One of the parameters has an invalid value."]
2561 MAV_MISSION_INVALID = 5,
2562 #[doc = "param1 has an invalid value."]
2563 MAV_MISSION_INVALID_PARAM1 = 6,
2564 #[doc = "param2 has an invalid value."]
2565 MAV_MISSION_INVALID_PARAM2 = 7,
2566 #[doc = "param3 has an invalid value."]
2567 MAV_MISSION_INVALID_PARAM3 = 8,
2568 #[doc = "param4 has an invalid value."]
2569 MAV_MISSION_INVALID_PARAM4 = 9,
2570 #[doc = "x / param5 has an invalid value."]
2571 MAV_MISSION_INVALID_PARAM5_X = 10,
2572 #[doc = "y / param6 has an invalid value."]
2573 MAV_MISSION_INVALID_PARAM6_Y = 11,
2574 #[doc = "z / param7 has an invalid value."]
2575 MAV_MISSION_INVALID_PARAM7 = 12,
2576 #[doc = "Mission item received out of sequence"]
2577 MAV_MISSION_INVALID_SEQUENCE = 13,
2578 #[doc = "Not accepting any mission commands from this communication partner."]
2579 MAV_MISSION_DENIED = 14,
2580 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2581 MAV_MISSION_OPERATION_CANCELLED = 15,
2582}
2583impl MavMissionResult {
2584 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2585}
2586impl Default for MavMissionResult {
2587 fn default() -> Self {
2588 Self::DEFAULT
2589 }
2590}
2591#[cfg_attr(feature = "ts", derive(TS))]
2592#[cfg_attr(feature = "ts", ts(export))]
2593#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2594#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2595#[cfg_attr(feature = "serde", serde(tag = "type"))]
2596#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2597#[repr(u32)]
2598#[doc = "Type of mission items being requested/sent in mission protocol."]
2599pub enum MavMissionType {
2600 #[doc = "Items are mission commands for main mission."]
2601 MAV_MISSION_TYPE_MISSION = 0,
2602 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2603 MAV_MISSION_TYPE_FENCE = 1,
2604 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2605 MAV_MISSION_TYPE_RALLY = 2,
2606 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2607 MAV_MISSION_TYPE_ALL = 255,
2608}
2609impl MavMissionType {
2610 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2611}
2612impl Default for MavMissionType {
2613 fn default() -> Self {
2614 Self::DEFAULT
2615 }
2616}
2617#[cfg_attr(feature = "ts", derive(TS))]
2618#[cfg_attr(feature = "ts", ts(export))]
2619#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2620#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2621#[cfg_attr(feature = "serde", serde(tag = "type"))]
2622#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2623#[repr(u32)]
2624#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2625pub enum MavMode {
2626 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2627 MAV_MODE_PREFLIGHT = 0,
2628 #[doc = "System is allowed to be active, under assisted RC control."]
2629 MAV_MODE_STABILIZE_DISARMED = 80,
2630 #[doc = "System is allowed to be active, under assisted RC control."]
2631 MAV_MODE_STABILIZE_ARMED = 208,
2632 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2633 MAV_MODE_MANUAL_DISARMED = 64,
2634 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2635 MAV_MODE_MANUAL_ARMED = 192,
2636 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2637 MAV_MODE_GUIDED_DISARMED = 88,
2638 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2639 MAV_MODE_GUIDED_ARMED = 216,
2640 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2641 MAV_MODE_AUTO_DISARMED = 92,
2642 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2643 MAV_MODE_AUTO_ARMED = 220,
2644 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2645 MAV_MODE_TEST_DISARMED = 66,
2646 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2647 MAV_MODE_TEST_ARMED = 194,
2648}
2649impl MavMode {
2650 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2651}
2652impl Default for MavMode {
2653 fn default() -> Self {
2654 Self::DEFAULT
2655 }
2656}
2657bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2658impl MavModeFlag {
2659 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2660}
2661impl Default for MavModeFlag {
2662 fn default() -> Self {
2663 Self::DEFAULT
2664 }
2665}
2666#[cfg_attr(feature = "ts", derive(TS))]
2667#[cfg_attr(feature = "ts", ts(export))]
2668#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2669#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2670#[cfg_attr(feature = "serde", serde(tag = "type"))]
2671#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2672#[repr(u32)]
2673#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2674pub enum MavModeFlagDecodePosition {
2675 #[doc = "First bit: 10000000"]
2676 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2677 #[doc = "Second bit: 01000000"]
2678 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2679 #[doc = "Third bit: 00100000"]
2680 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2681 #[doc = "Fourth bit: 00010000"]
2682 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2683 #[doc = "Fifth bit: 00001000"]
2684 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2685 #[doc = "Sixth bit: 00000100"]
2686 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2687 #[doc = "Seventh bit: 00000010"]
2688 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2689 #[doc = "Eighth bit: 00000001"]
2690 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2691}
2692impl MavModeFlagDecodePosition {
2693 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2694}
2695impl Default for MavModeFlagDecodePosition {
2696 fn default() -> Self {
2697 Self::DEFAULT
2698 }
2699}
2700bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2701impl MavModeProperty {
2702 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2703}
2704impl Default for MavModeProperty {
2705 fn default() -> Self {
2706 Self::DEFAULT
2707 }
2708}
2709#[cfg_attr(feature = "ts", derive(TS))]
2710#[cfg_attr(feature = "ts", ts(export))]
2711#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2712#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2713#[cfg_attr(feature = "serde", serde(tag = "type"))]
2714#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2715#[repr(u32)]
2716#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2717#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2718pub enum MavMountMode {
2719 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2720 MAV_MOUNT_MODE_RETRACT = 0,
2721 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2722 MAV_MOUNT_MODE_NEUTRAL = 1,
2723 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2724 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2725 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2726 MAV_MOUNT_MODE_RC_TARGETING = 3,
2727 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2728 MAV_MOUNT_MODE_GPS_POINT = 4,
2729 #[doc = "Gimbal tracks system with specified system ID"]
2730 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2731 #[doc = "Gimbal tracks home position"]
2732 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2733}
2734impl MavMountMode {
2735 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2736}
2737impl Default for MavMountMode {
2738 fn default() -> Self {
2739 Self::DEFAULT
2740 }
2741}
2742#[cfg_attr(feature = "ts", derive(TS))]
2743#[cfg_attr(feature = "ts", ts(export))]
2744#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2745#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2746#[cfg_attr(feature = "serde", serde(tag = "type"))]
2747#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2748#[repr(u32)]
2749pub enum MavOdidArmStatus {
2750 #[doc = "Passing arming checks."]
2751 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2752 #[doc = "Generic arming failure, see error string for details."]
2753 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2754}
2755impl MavOdidArmStatus {
2756 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2757}
2758impl Default for MavOdidArmStatus {
2759 fn default() -> Self {
2760 Self::DEFAULT
2761 }
2762}
2763#[cfg_attr(feature = "ts", derive(TS))]
2764#[cfg_attr(feature = "ts", ts(export))]
2765#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2766#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2767#[cfg_attr(feature = "serde", serde(tag = "type"))]
2768#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2769#[repr(u32)]
2770pub enum MavOdidAuthType {
2771 #[doc = "No authentication type is specified."]
2772 MAV_ODID_AUTH_TYPE_NONE = 0,
2773 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2774 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2775 #[doc = "Signature for the Operator ID."]
2776 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2777 #[doc = "Signature for the entire message set."]
2778 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2779 #[doc = "Authentication is provided by Network Remote ID."]
2780 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2781 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2782 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2783}
2784impl MavOdidAuthType {
2785 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2786}
2787impl Default for MavOdidAuthType {
2788 fn default() -> Self {
2789 Self::DEFAULT
2790 }
2791}
2792#[cfg_attr(feature = "ts", derive(TS))]
2793#[cfg_attr(feature = "ts", ts(export))]
2794#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2795#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2796#[cfg_attr(feature = "serde", serde(tag = "type"))]
2797#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2798#[repr(u32)]
2799pub enum MavOdidCategoryEu {
2800 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2801 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2802 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2803 MAV_ODID_CATEGORY_EU_OPEN = 1,
2804 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2805 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2806 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2807 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2808}
2809impl MavOdidCategoryEu {
2810 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2811}
2812impl Default for MavOdidCategoryEu {
2813 fn default() -> Self {
2814 Self::DEFAULT
2815 }
2816}
2817#[cfg_attr(feature = "ts", derive(TS))]
2818#[cfg_attr(feature = "ts", ts(export))]
2819#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2820#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2821#[cfg_attr(feature = "serde", serde(tag = "type"))]
2822#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2823#[repr(u32)]
2824pub enum MavOdidClassEu {
2825 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2826 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2827 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2828 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2829 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2830 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2831 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2832 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2833 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2834 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2835 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2836 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2837 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2838 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2839 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2840 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2841}
2842impl MavOdidClassEu {
2843 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2844}
2845impl Default for MavOdidClassEu {
2846 fn default() -> Self {
2847 Self::DEFAULT
2848 }
2849}
2850#[cfg_attr(feature = "ts", derive(TS))]
2851#[cfg_attr(feature = "ts", ts(export))]
2852#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2853#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2854#[cfg_attr(feature = "serde", serde(tag = "type"))]
2855#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2856#[repr(u32)]
2857pub enum MavOdidClassificationType {
2858 #[doc = "The classification type for the UA is undeclared."]
2859 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2860 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2861 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2862}
2863impl MavOdidClassificationType {
2864 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2865}
2866impl Default for MavOdidClassificationType {
2867 fn default() -> Self {
2868 Self::DEFAULT
2869 }
2870}
2871#[cfg_attr(feature = "ts", derive(TS))]
2872#[cfg_attr(feature = "ts", ts(export))]
2873#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2874#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2875#[cfg_attr(feature = "serde", serde(tag = "type"))]
2876#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2877#[repr(u32)]
2878pub enum MavOdidDescType {
2879 #[doc = "Optional free-form text description of the purpose of the flight."]
2880 MAV_ODID_DESC_TYPE_TEXT = 0,
2881 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2882 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2883 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2884 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2885}
2886impl MavOdidDescType {
2887 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2888}
2889impl Default for MavOdidDescType {
2890 fn default() -> Self {
2891 Self::DEFAULT
2892 }
2893}
2894#[cfg_attr(feature = "ts", derive(TS))]
2895#[cfg_attr(feature = "ts", ts(export))]
2896#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2897#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2898#[cfg_attr(feature = "serde", serde(tag = "type"))]
2899#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2900#[repr(u32)]
2901pub enum MavOdidHeightRef {
2902 #[doc = "The height field is relative to the take-off location."]
2903 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2904 #[doc = "The height field is relative to ground."]
2905 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2906}
2907impl MavOdidHeightRef {
2908 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2909}
2910impl Default for MavOdidHeightRef {
2911 fn default() -> Self {
2912 Self::DEFAULT
2913 }
2914}
2915#[cfg_attr(feature = "ts", derive(TS))]
2916#[cfg_attr(feature = "ts", ts(export))]
2917#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2918#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2919#[cfg_attr(feature = "serde", serde(tag = "type"))]
2920#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2921#[repr(u32)]
2922pub enum MavOdidHorAcc {
2923 #[doc = "The horizontal accuracy is unknown."]
2924 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2925 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2926 MAV_ODID_HOR_ACC_10NM = 1,
2927 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2928 MAV_ODID_HOR_ACC_4NM = 2,
2929 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2930 MAV_ODID_HOR_ACC_2NM = 3,
2931 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2932 MAV_ODID_HOR_ACC_1NM = 4,
2933 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2934 MAV_ODID_HOR_ACC_0_5NM = 5,
2935 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2936 MAV_ODID_HOR_ACC_0_3NM = 6,
2937 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2938 MAV_ODID_HOR_ACC_0_1NM = 7,
2939 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2940 MAV_ODID_HOR_ACC_0_05NM = 8,
2941 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2942 MAV_ODID_HOR_ACC_30_METER = 9,
2943 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2944 MAV_ODID_HOR_ACC_10_METER = 10,
2945 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2946 MAV_ODID_HOR_ACC_3_METER = 11,
2947 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2948 MAV_ODID_HOR_ACC_1_METER = 12,
2949}
2950impl MavOdidHorAcc {
2951 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2952}
2953impl Default for MavOdidHorAcc {
2954 fn default() -> Self {
2955 Self::DEFAULT
2956 }
2957}
2958#[cfg_attr(feature = "ts", derive(TS))]
2959#[cfg_attr(feature = "ts", ts(export))]
2960#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2961#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2962#[cfg_attr(feature = "serde", serde(tag = "type"))]
2963#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2964#[repr(u32)]
2965pub enum MavOdidIdType {
2966 #[doc = "No type defined."]
2967 MAV_ODID_ID_TYPE_NONE = 0,
2968 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2969 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2970 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2971 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2972 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2973 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2974 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2975 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2976}
2977impl MavOdidIdType {
2978 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2979}
2980impl Default for MavOdidIdType {
2981 fn default() -> Self {
2982 Self::DEFAULT
2983 }
2984}
2985#[cfg_attr(feature = "ts", derive(TS))]
2986#[cfg_attr(feature = "ts", ts(export))]
2987#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2988#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2989#[cfg_attr(feature = "serde", serde(tag = "type"))]
2990#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2991#[repr(u32)]
2992pub enum MavOdidOperatorIdType {
2993 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2994 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2995}
2996impl MavOdidOperatorIdType {
2997 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
2998}
2999impl Default for MavOdidOperatorIdType {
3000 fn default() -> Self {
3001 Self::DEFAULT
3002 }
3003}
3004#[cfg_attr(feature = "ts", derive(TS))]
3005#[cfg_attr(feature = "ts", ts(export))]
3006#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3007#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3008#[cfg_attr(feature = "serde", serde(tag = "type"))]
3009#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3010#[repr(u32)]
3011pub enum MavOdidOperatorLocationType {
3012 #[doc = "The location/altitude of the operator is the same as the take-off location."]
3013 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
3014 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
3015 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
3016 #[doc = "The location/altitude of the operator are fixed values."]
3017 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
3018}
3019impl MavOdidOperatorLocationType {
3020 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
3021}
3022impl Default for MavOdidOperatorLocationType {
3023 fn default() -> Self {
3024 Self::DEFAULT
3025 }
3026}
3027#[cfg_attr(feature = "ts", derive(TS))]
3028#[cfg_attr(feature = "ts", ts(export))]
3029#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3030#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3031#[cfg_attr(feature = "serde", serde(tag = "type"))]
3032#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3033#[repr(u32)]
3034pub enum MavOdidSpeedAcc {
3035 #[doc = "The speed accuracy is unknown."]
3036 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
3037 #[doc = "The speed accuracy is smaller than 10 meters per second."]
3038 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
3039 #[doc = "The speed accuracy is smaller than 3 meters per second."]
3040 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
3041 #[doc = "The speed accuracy is smaller than 1 meters per second."]
3042 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
3043 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
3044 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
3045}
3046impl MavOdidSpeedAcc {
3047 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
3048}
3049impl Default for MavOdidSpeedAcc {
3050 fn default() -> Self {
3051 Self::DEFAULT
3052 }
3053}
3054#[cfg_attr(feature = "ts", derive(TS))]
3055#[cfg_attr(feature = "ts", ts(export))]
3056#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3057#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3058#[cfg_attr(feature = "serde", serde(tag = "type"))]
3059#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3060#[repr(u32)]
3061pub enum MavOdidStatus {
3062 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
3063 MAV_ODID_STATUS_UNDECLARED = 0,
3064 #[doc = "The UA is on the ground."]
3065 MAV_ODID_STATUS_GROUND = 1,
3066 #[doc = "The UA is in the air."]
3067 MAV_ODID_STATUS_AIRBORNE = 2,
3068 #[doc = "The UA is having an emergency."]
3069 MAV_ODID_STATUS_EMERGENCY = 3,
3070 #[doc = "The remote ID system is failing or unreliable in some way."]
3071 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
3072}
3073impl MavOdidStatus {
3074 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
3075}
3076impl Default for MavOdidStatus {
3077 fn default() -> Self {
3078 Self::DEFAULT
3079 }
3080}
3081#[cfg_attr(feature = "ts", derive(TS))]
3082#[cfg_attr(feature = "ts", ts(export))]
3083#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3084#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3085#[cfg_attr(feature = "serde", serde(tag = "type"))]
3086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3087#[repr(u32)]
3088pub enum MavOdidTimeAcc {
3089 #[doc = "The timestamp accuracy is unknown."]
3090 MAV_ODID_TIME_ACC_UNKNOWN = 0,
3091 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
3092 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
3093 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
3094 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
3095 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
3096 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
3097 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
3098 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
3099 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
3100 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
3101 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
3102 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
3103 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
3104 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
3105 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
3106 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
3107 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
3108 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
3109 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
3110 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
3111 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
3112 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
3113 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
3114 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
3115 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
3116 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
3117 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
3118 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
3119 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
3120 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
3121}
3122impl MavOdidTimeAcc {
3123 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
3124}
3125impl Default for MavOdidTimeAcc {
3126 fn default() -> Self {
3127 Self::DEFAULT
3128 }
3129}
3130#[cfg_attr(feature = "ts", derive(TS))]
3131#[cfg_attr(feature = "ts", ts(export))]
3132#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3133#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3134#[cfg_attr(feature = "serde", serde(tag = "type"))]
3135#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3136#[repr(u32)]
3137pub enum MavOdidUaType {
3138 #[doc = "No UA (Unmanned Aircraft) type defined."]
3139 MAV_ODID_UA_TYPE_NONE = 0,
3140 #[doc = "Aeroplane/Airplane. Fixed wing."]
3141 MAV_ODID_UA_TYPE_AEROPLANE = 1,
3142 #[doc = "Helicopter or multirotor."]
3143 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
3144 #[doc = "Gyroplane."]
3145 MAV_ODID_UA_TYPE_GYROPLANE = 3,
3146 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
3147 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3148 #[doc = "Ornithopter."]
3149 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3150 #[doc = "Glider."]
3151 MAV_ODID_UA_TYPE_GLIDER = 6,
3152 #[doc = "Kite."]
3153 MAV_ODID_UA_TYPE_KITE = 7,
3154 #[doc = "Free Balloon."]
3155 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3156 #[doc = "Captive Balloon."]
3157 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3158 #[doc = "Airship. E.g. a blimp."]
3159 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3160 #[doc = "Free Fall/Parachute (unpowered)."]
3161 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3162 #[doc = "Rocket."]
3163 MAV_ODID_UA_TYPE_ROCKET = 12,
3164 #[doc = "Tethered powered aircraft."]
3165 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3166 #[doc = "Ground Obstacle."]
3167 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3168 #[doc = "Other type of aircraft not listed earlier."]
3169 MAV_ODID_UA_TYPE_OTHER = 15,
3170}
3171impl MavOdidUaType {
3172 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3173}
3174impl Default for MavOdidUaType {
3175 fn default() -> Self {
3176 Self::DEFAULT
3177 }
3178}
3179#[cfg_attr(feature = "ts", derive(TS))]
3180#[cfg_attr(feature = "ts", ts(export))]
3181#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3182#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3183#[cfg_attr(feature = "serde", serde(tag = "type"))]
3184#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3185#[repr(u32)]
3186pub enum MavOdidVerAcc {
3187 #[doc = "The vertical accuracy is unknown."]
3188 MAV_ODID_VER_ACC_UNKNOWN = 0,
3189 #[doc = "The vertical accuracy is smaller than 150 meter."]
3190 MAV_ODID_VER_ACC_150_METER = 1,
3191 #[doc = "The vertical accuracy is smaller than 45 meter."]
3192 MAV_ODID_VER_ACC_45_METER = 2,
3193 #[doc = "The vertical accuracy is smaller than 25 meter."]
3194 MAV_ODID_VER_ACC_25_METER = 3,
3195 #[doc = "The vertical accuracy is smaller than 10 meter."]
3196 MAV_ODID_VER_ACC_10_METER = 4,
3197 #[doc = "The vertical accuracy is smaller than 3 meter."]
3198 MAV_ODID_VER_ACC_3_METER = 5,
3199 #[doc = "The vertical accuracy is smaller than 1 meter."]
3200 MAV_ODID_VER_ACC_1_METER = 6,
3201}
3202impl MavOdidVerAcc {
3203 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3204}
3205impl Default for MavOdidVerAcc {
3206 fn default() -> Self {
3207 Self::DEFAULT
3208 }
3209}
3210#[cfg_attr(feature = "ts", derive(TS))]
3211#[cfg_attr(feature = "ts", ts(export))]
3212#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3213#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3214#[cfg_attr(feature = "serde", serde(tag = "type"))]
3215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3216#[repr(u32)]
3217#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3218pub enum MavParamExtType {
3219 #[doc = "8-bit unsigned integer"]
3220 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3221 #[doc = "8-bit signed integer"]
3222 MAV_PARAM_EXT_TYPE_INT8 = 2,
3223 #[doc = "16-bit unsigned integer"]
3224 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3225 #[doc = "16-bit signed integer"]
3226 MAV_PARAM_EXT_TYPE_INT16 = 4,
3227 #[doc = "32-bit unsigned integer"]
3228 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3229 #[doc = "32-bit signed integer"]
3230 MAV_PARAM_EXT_TYPE_INT32 = 6,
3231 #[doc = "64-bit unsigned integer"]
3232 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3233 #[doc = "64-bit signed integer"]
3234 MAV_PARAM_EXT_TYPE_INT64 = 8,
3235 #[doc = "32-bit floating-point"]
3236 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3237 #[doc = "64-bit floating-point"]
3238 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3239 #[doc = "Custom Type"]
3240 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3241}
3242impl MavParamExtType {
3243 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3244}
3245impl Default for MavParamExtType {
3246 fn default() -> Self {
3247 Self::DEFAULT
3248 }
3249}
3250#[cfg_attr(feature = "ts", derive(TS))]
3251#[cfg_attr(feature = "ts", ts(export))]
3252#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3253#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3254#[cfg_attr(feature = "serde", serde(tag = "type"))]
3255#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3256#[repr(u32)]
3257#[doc = "Specifies the datatype of a MAVLink parameter."]
3258pub enum MavParamType {
3259 #[doc = "8-bit unsigned integer"]
3260 MAV_PARAM_TYPE_UINT8 = 1,
3261 #[doc = "8-bit signed integer"]
3262 MAV_PARAM_TYPE_INT8 = 2,
3263 #[doc = "16-bit unsigned integer"]
3264 MAV_PARAM_TYPE_UINT16 = 3,
3265 #[doc = "16-bit signed integer"]
3266 MAV_PARAM_TYPE_INT16 = 4,
3267 #[doc = "32-bit unsigned integer"]
3268 MAV_PARAM_TYPE_UINT32 = 5,
3269 #[doc = "32-bit signed integer"]
3270 MAV_PARAM_TYPE_INT32 = 6,
3271 #[doc = "64-bit unsigned integer"]
3272 MAV_PARAM_TYPE_UINT64 = 7,
3273 #[doc = "64-bit signed integer"]
3274 MAV_PARAM_TYPE_INT64 = 8,
3275 #[doc = "32-bit floating-point"]
3276 MAV_PARAM_TYPE_REAL32 = 9,
3277 #[doc = "64-bit floating-point"]
3278 MAV_PARAM_TYPE_REAL64 = 10,
3279}
3280impl MavParamType {
3281 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3282}
3283impl Default for MavParamType {
3284 fn default() -> Self {
3285 Self::DEFAULT
3286 }
3287}
3288bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3289impl MavPowerStatus {
3290 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3291}
3292impl Default for MavPowerStatus {
3293 fn default() -> Self {
3294 Self::DEFAULT
3295 }
3296}
3297bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3298impl MavProtocolCapability {
3299 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3300}
3301impl Default for MavProtocolCapability {
3302 fn default() -> Self {
3303 Self::DEFAULT
3304 }
3305}
3306#[cfg_attr(feature = "ts", derive(TS))]
3307#[cfg_attr(feature = "ts", ts(export))]
3308#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3309#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3310#[cfg_attr(feature = "serde", serde(tag = "type"))]
3311#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3312#[repr(u32)]
3313#[doc = "Result from a MAVLink command (MAV_CMD)"]
3314pub enum MavResult {
3315 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3316 MAV_RESULT_ACCEPTED = 0,
3317 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3318 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3319 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3320 MAV_RESULT_DENIED = 2,
3321 #[doc = "Command is not supported (unknown)."]
3322 MAV_RESULT_UNSUPPORTED = 3,
3323 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3324 MAV_RESULT_FAILED = 4,
3325 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3326 MAV_RESULT_IN_PROGRESS = 5,
3327 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3328 MAV_RESULT_CANCELLED = 6,
3329 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3330 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3331 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3332 MAV_RESULT_COMMAND_INT_ONLY = 8,
3333 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3334 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3335}
3336impl MavResult {
3337 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3338}
3339impl Default for MavResult {
3340 fn default() -> Self {
3341 Self::DEFAULT
3342 }
3343}
3344#[cfg_attr(feature = "ts", derive(TS))]
3345#[cfg_attr(feature = "ts", ts(export))]
3346#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3347#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3348#[cfg_attr(feature = "serde", serde(tag = "type"))]
3349#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3350#[repr(u32)]
3351#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3352#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3353pub enum MavRoi {
3354 #[doc = "No region of interest."]
3355 MAV_ROI_NONE = 0,
3356 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3357 MAV_ROI_WPNEXT = 1,
3358 #[doc = "Point toward given waypoint."]
3359 MAV_ROI_WPINDEX = 2,
3360 #[doc = "Point toward fixed location."]
3361 MAV_ROI_LOCATION = 3,
3362 #[doc = "Point toward of given id."]
3363 MAV_ROI_TARGET = 4,
3364}
3365impl MavRoi {
3366 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3367}
3368impl Default for MavRoi {
3369 fn default() -> Self {
3370 Self::DEFAULT
3371 }
3372}
3373#[cfg_attr(feature = "ts", derive(TS))]
3374#[cfg_attr(feature = "ts", ts(export))]
3375#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3376#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3377#[cfg_attr(feature = "serde", serde(tag = "type"))]
3378#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3379#[repr(u32)]
3380#[doc = "Enumeration of sensor orientation, according to its rotations"]
3381pub enum MavSensorOrientation {
3382 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3383 MAV_SENSOR_ROTATION_NONE = 0,
3384 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3385 MAV_SENSOR_ROTATION_YAW_45 = 1,
3386 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3387 MAV_SENSOR_ROTATION_YAW_90 = 2,
3388 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3389 MAV_SENSOR_ROTATION_YAW_135 = 3,
3390 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3391 MAV_SENSOR_ROTATION_YAW_180 = 4,
3392 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3393 MAV_SENSOR_ROTATION_YAW_225 = 5,
3394 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3395 MAV_SENSOR_ROTATION_YAW_270 = 6,
3396 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3397 MAV_SENSOR_ROTATION_YAW_315 = 7,
3398 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3399 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3400 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3401 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3402 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3403 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3404 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3405 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3406 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3407 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3408 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3409 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3410 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3411 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3412 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3413 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3414 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3415 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3416 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3417 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3418 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3419 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3420 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3421 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3422 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3423 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3424 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3425 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3426 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3427 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3428 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3429 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3430 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3431 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3432 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3433 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3434 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3435 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3436 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3437 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3438 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3439 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3440 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3441 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3442 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3443 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3444 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3445 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3446 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3447 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3448 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3449 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3450 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3451 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3452 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3453 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3454 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3455 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3456 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3457 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3458 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3459 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3460 #[doc = "Pitch: 315"]
3461 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3462 #[doc = "Roll: 90, Pitch: 315"]
3463 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3464 #[doc = "Custom orientation"]
3465 MAV_SENSOR_ROTATION_CUSTOM = 100,
3466}
3467impl MavSensorOrientation {
3468 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3469}
3470impl Default for MavSensorOrientation {
3471 fn default() -> Self {
3472 Self::DEFAULT
3473 }
3474}
3475#[cfg_attr(feature = "ts", derive(TS))]
3476#[cfg_attr(feature = "ts", ts(export))]
3477#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3478#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3479#[cfg_attr(feature = "serde", serde(tag = "type"))]
3480#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3481#[repr(u32)]
3482#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3483pub enum MavSeverity {
3484 #[doc = "System is unusable. This is a \"panic\" condition."]
3485 MAV_SEVERITY_EMERGENCY = 0,
3486 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3487 MAV_SEVERITY_ALERT = 1,
3488 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3489 MAV_SEVERITY_CRITICAL = 2,
3490 #[doc = "Indicates an error in secondary/redundant systems."]
3491 MAV_SEVERITY_ERROR = 3,
3492 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3493 MAV_SEVERITY_WARNING = 4,
3494 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3495 MAV_SEVERITY_NOTICE = 5,
3496 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3497 MAV_SEVERITY_INFO = 6,
3498 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3499 MAV_SEVERITY_DEBUG = 7,
3500}
3501impl MavSeverity {
3502 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3503}
3504impl Default for MavSeverity {
3505 fn default() -> Self {
3506 Self::DEFAULT
3507 }
3508}
3509#[cfg_attr(feature = "ts", derive(TS))]
3510#[cfg_attr(feature = "ts", ts(export))]
3511#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3512#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3513#[cfg_attr(feature = "serde", serde(tag = "type"))]
3514#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3515#[repr(u32)]
3516#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3517pub enum MavStandardMode {
3518 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3519 MAV_STANDARD_MODE_NON_STANDARD = 0,
3520 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3521 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3522 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3523 MAV_STANDARD_MODE_ORBIT = 2,
3524 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3525 MAV_STANDARD_MODE_CRUISE = 3,
3526 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3527 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3528 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3529 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3530 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3531 MAV_STANDARD_MODE_MISSION = 6,
3532 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3533 MAV_STANDARD_MODE_LAND = 7,
3534 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3535 MAV_STANDARD_MODE_TAKEOFF = 8,
3536}
3537impl MavStandardMode {
3538 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3539}
3540impl Default for MavStandardMode {
3541 fn default() -> Self {
3542 Self::DEFAULT
3543 }
3544}
3545#[cfg_attr(feature = "ts", derive(TS))]
3546#[cfg_attr(feature = "ts", ts(export))]
3547#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3548#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3549#[cfg_attr(feature = "serde", serde(tag = "type"))]
3550#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3551#[repr(u32)]
3552pub enum MavState {
3553 #[doc = "Uninitialized system, state is unknown."]
3554 MAV_STATE_UNINIT = 0,
3555 #[doc = "System is booting up."]
3556 MAV_STATE_BOOT = 1,
3557 #[doc = "System is calibrating and not flight-ready."]
3558 MAV_STATE_CALIBRATING = 2,
3559 #[doc = "System is grounded and on standby. It can be launched any time."]
3560 MAV_STATE_STANDBY = 3,
3561 #[doc = "System is active and might be already airborne. Motors are engaged."]
3562 MAV_STATE_ACTIVE = 4,
3563 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3564 MAV_STATE_CRITICAL = 5,
3565 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3566 MAV_STATE_EMERGENCY = 6,
3567 #[doc = "System just initialized its power-down sequence, will shut down now."]
3568 MAV_STATE_POWEROFF = 7,
3569 #[doc = "System is terminating itself (failsafe or commanded)."]
3570 MAV_STATE_FLIGHT_TERMINATION = 8,
3571}
3572impl MavState {
3573 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3574}
3575impl Default for MavState {
3576 fn default() -> Self {
3577 Self::DEFAULT
3578 }
3579}
3580bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3581impl MavSysStatusSensor {
3582 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3583}
3584impl Default for MavSysStatusSensor {
3585 fn default() -> Self {
3586 Self::DEFAULT
3587 }
3588}
3589bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3590impl MavSysStatusSensorExtended {
3591 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3592}
3593impl Default for MavSysStatusSensorExtended {
3594 fn default() -> Self {
3595 Self::DEFAULT
3596 }
3597}
3598#[cfg_attr(feature = "ts", derive(TS))]
3599#[cfg_attr(feature = "ts", ts(export))]
3600#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3601#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3602#[cfg_attr(feature = "serde", serde(tag = "type"))]
3603#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3604#[repr(u32)]
3605pub enum MavTunnelPayloadType {
3606 #[doc = "Encoding of payload unknown."]
3607 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3608 #[doc = "Registered for STorM32 gimbal controller."]
3609 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3610 #[doc = "Registered for STorM32 gimbal controller."]
3611 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3612 #[doc = "Registered for STorM32 gimbal controller."]
3613 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3614 #[doc = "Registered for STorM32 gimbal controller."]
3615 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3616 #[doc = "Registered for STorM32 gimbal controller."]
3617 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3618 #[doc = "Registered for STorM32 gimbal controller."]
3619 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3620 #[doc = "Registered for STorM32 gimbal controller."]
3621 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3622 #[doc = "Registered for STorM32 gimbal controller."]
3623 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3624 #[doc = "Registered for STorM32 gimbal controller."]
3625 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3626 #[doc = "Registered for STorM32 gimbal controller."]
3627 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3628 #[doc = "Registered for ModalAI remote OSD protocol."]
3629 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3630 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3631 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3632 #[doc = "Registered for ModalAI vendor use."]
3633 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3634}
3635impl MavTunnelPayloadType {
3636 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3637}
3638impl Default for MavTunnelPayloadType {
3639 fn default() -> Self {
3640 Self::DEFAULT
3641 }
3642}
3643#[cfg_attr(feature = "ts", derive(TS))]
3644#[cfg_attr(feature = "ts", ts(export))]
3645#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3646#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3647#[cfg_attr(feature = "serde", serde(tag = "type"))]
3648#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3649#[repr(u32)]
3650#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3651pub enum MavType {
3652 #[doc = "Generic micro air vehicle"]
3653 MAV_TYPE_GENERIC = 0,
3654 #[doc = "Fixed wing aircraft."]
3655 MAV_TYPE_FIXED_WING = 1,
3656 #[doc = "Quadrotor"]
3657 MAV_TYPE_QUADROTOR = 2,
3658 #[doc = "Coaxial helicopter"]
3659 MAV_TYPE_COAXIAL = 3,
3660 #[doc = "Normal helicopter with tail rotor."]
3661 MAV_TYPE_HELICOPTER = 4,
3662 #[doc = "Ground installation"]
3663 MAV_TYPE_ANTENNA_TRACKER = 5,
3664 #[doc = "Operator control unit / ground control station"]
3665 MAV_TYPE_GCS = 6,
3666 #[doc = "Airship, controlled"]
3667 MAV_TYPE_AIRSHIP = 7,
3668 #[doc = "Free balloon, uncontrolled"]
3669 MAV_TYPE_FREE_BALLOON = 8,
3670 #[doc = "Rocket"]
3671 MAV_TYPE_ROCKET = 9,
3672 #[doc = "Ground rover"]
3673 MAV_TYPE_GROUND_ROVER = 10,
3674 #[doc = "Surface vessel, boat, ship"]
3675 MAV_TYPE_SURFACE_BOAT = 11,
3676 #[doc = "Submarine"]
3677 MAV_TYPE_SUBMARINE = 12,
3678 #[doc = "Hexarotor"]
3679 MAV_TYPE_HEXAROTOR = 13,
3680 #[doc = "Octorotor"]
3681 MAV_TYPE_OCTOROTOR = 14,
3682 #[doc = "Tricopter"]
3683 MAV_TYPE_TRICOPTER = 15,
3684 #[doc = "Flapping wing"]
3685 MAV_TYPE_FLAPPING_WING = 16,
3686 #[doc = "Kite"]
3687 MAV_TYPE_KITE = 17,
3688 #[doc = "Onboard companion controller"]
3689 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3690 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3691 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3692 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3693 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3694 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3695 MAV_TYPE_VTOL_TILTROTOR = 21,
3696 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3697 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3698 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3699 MAV_TYPE_VTOL_TAILSITTER = 23,
3700 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3701 MAV_TYPE_VTOL_TILTWING = 24,
3702 #[doc = "VTOL reserved 5"]
3703 MAV_TYPE_VTOL_RESERVED5 = 25,
3704 #[doc = "Gimbal"]
3705 MAV_TYPE_GIMBAL = 26,
3706 #[doc = "ADSB system"]
3707 MAV_TYPE_ADSB = 27,
3708 #[doc = "Steerable, nonrigid airfoil"]
3709 MAV_TYPE_PARAFOIL = 28,
3710 #[doc = "Dodecarotor"]
3711 MAV_TYPE_DODECAROTOR = 29,
3712 #[doc = "Camera"]
3713 MAV_TYPE_CAMERA = 30,
3714 #[doc = "Charging station"]
3715 MAV_TYPE_CHARGING_STATION = 31,
3716 #[doc = "FLARM collision avoidance system"]
3717 MAV_TYPE_FLARM = 32,
3718 #[doc = "Servo"]
3719 MAV_TYPE_SERVO = 33,
3720 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3721 MAV_TYPE_ODID = 34,
3722 #[doc = "Decarotor"]
3723 MAV_TYPE_DECAROTOR = 35,
3724 #[doc = "Battery"]
3725 MAV_TYPE_BATTERY = 36,
3726 #[doc = "Parachute"]
3727 MAV_TYPE_PARACHUTE = 37,
3728 #[doc = "Log"]
3729 MAV_TYPE_LOG = 38,
3730 #[doc = "OSD"]
3731 MAV_TYPE_OSD = 39,
3732 #[doc = "IMU"]
3733 MAV_TYPE_IMU = 40,
3734 #[doc = "GPS"]
3735 MAV_TYPE_GPS = 41,
3736 #[doc = "Winch"]
3737 MAV_TYPE_WINCH = 42,
3738 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3739 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3740 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3741 MAV_TYPE_ILLUMINATOR = 44,
3742 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3743 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3744}
3745impl MavType {
3746 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3747}
3748impl Default for MavType {
3749 fn default() -> Self {
3750 Self::DEFAULT
3751 }
3752}
3753#[cfg_attr(feature = "ts", derive(TS))]
3754#[cfg_attr(feature = "ts", ts(export))]
3755#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3756#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3757#[cfg_attr(feature = "serde", serde(tag = "type"))]
3758#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3759#[repr(u32)]
3760#[doc = "Enumeration of VTOL states"]
3761pub enum MavVtolState {
3762 #[doc = "MAV is not configured as VTOL"]
3763 MAV_VTOL_STATE_UNDEFINED = 0,
3764 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3765 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3766 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3767 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3768 #[doc = "VTOL is in multicopter state"]
3769 MAV_VTOL_STATE_MC = 3,
3770 #[doc = "VTOL is in fixed-wing state"]
3771 MAV_VTOL_STATE_FW = 4,
3772}
3773impl MavVtolState {
3774 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3775}
3776impl Default for MavVtolState {
3777 fn default() -> Self {
3778 Self::DEFAULT
3779 }
3780}
3781bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3782impl MavWinchStatusFlag {
3783 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3784}
3785impl Default for MavWinchStatusFlag {
3786 fn default() -> Self {
3787 Self::DEFAULT
3788 }
3789}
3790#[cfg_attr(feature = "ts", derive(TS))]
3791#[cfg_attr(feature = "ts", ts(export))]
3792#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3793#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3794#[cfg_attr(feature = "serde", serde(tag = "type"))]
3795#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3796#[repr(u32)]
3797pub enum MavlinkDataStreamType {
3798 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3799 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3800 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3801 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3802 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3803 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3804}
3805impl MavlinkDataStreamType {
3806 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3807}
3808impl Default for MavlinkDataStreamType {
3809 fn default() -> Self {
3810 Self::DEFAULT
3811 }
3812}
3813#[cfg_attr(feature = "ts", derive(TS))]
3814#[cfg_attr(feature = "ts", ts(export))]
3815#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3816#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3817#[cfg_attr(feature = "serde", serde(tag = "type"))]
3818#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3819#[repr(u32)]
3820#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3821pub enum MissionState {
3822 #[doc = "The mission status reporting is not supported."]
3823 MISSION_STATE_UNKNOWN = 0,
3824 #[doc = "No mission on the vehicle."]
3825 MISSION_STATE_NO_MISSION = 1,
3826 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3827 MISSION_STATE_NOT_STARTED = 2,
3828 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3829 MISSION_STATE_ACTIVE = 3,
3830 #[doc = "Mission is paused when in auto mode."]
3831 MISSION_STATE_PAUSED = 4,
3832 #[doc = "Mission has executed all mission items."]
3833 MISSION_STATE_COMPLETE = 5,
3834}
3835impl MissionState {
3836 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3837}
3838impl Default for MissionState {
3839 fn default() -> Self {
3840 Self::DEFAULT
3841 }
3842}
3843#[cfg_attr(feature = "ts", derive(TS))]
3844#[cfg_attr(feature = "ts", ts(export))]
3845#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3846#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3847#[cfg_attr(feature = "serde", serde(tag = "type"))]
3848#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3849#[repr(u32)]
3850#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3851pub enum MotorTestOrder {
3852 #[doc = "Default autopilot motor test method."]
3853 MOTOR_TEST_ORDER_DEFAULT = 0,
3854 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3855 MOTOR_TEST_ORDER_SEQUENCE = 1,
3856 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3857 MOTOR_TEST_ORDER_BOARD = 2,
3858}
3859impl MotorTestOrder {
3860 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3861}
3862impl Default for MotorTestOrder {
3863 fn default() -> Self {
3864 Self::DEFAULT
3865 }
3866}
3867#[cfg_attr(feature = "ts", derive(TS))]
3868#[cfg_attr(feature = "ts", ts(export))]
3869#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3870#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3871#[cfg_attr(feature = "serde", serde(tag = "type"))]
3872#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3873#[repr(u32)]
3874#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3875pub enum MotorTestThrottleType {
3876 #[doc = "Throttle as a percentage (0 ~ 100)"]
3877 MOTOR_TEST_THROTTLE_PERCENT = 0,
3878 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3879 MOTOR_TEST_THROTTLE_PWM = 1,
3880 #[doc = "Throttle pass-through from pilot's transmitter."]
3881 MOTOR_TEST_THROTTLE_PILOT = 2,
3882 #[doc = "Per-motor compass calibration test."]
3883 MOTOR_TEST_COMPASS_CAL = 3,
3884}
3885impl MotorTestThrottleType {
3886 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3887}
3888impl Default for MotorTestThrottleType {
3889 fn default() -> Self {
3890 Self::DEFAULT
3891 }
3892}
3893#[cfg_attr(feature = "ts", derive(TS))]
3894#[cfg_attr(feature = "ts", ts(export))]
3895#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3896#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3897#[cfg_attr(feature = "serde", serde(tag = "type"))]
3898#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3899#[repr(u32)]
3900pub enum NavVtolLandOptions {
3901 #[doc = "Default autopilot landing behaviour."]
3902 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3903 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3904 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3905 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3906 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3907}
3908impl NavVtolLandOptions {
3909 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3910}
3911impl Default for NavVtolLandOptions {
3912 fn default() -> Self {
3913 Self::DEFAULT
3914 }
3915}
3916#[cfg_attr(feature = "ts", derive(TS))]
3917#[cfg_attr(feature = "ts", ts(export))]
3918#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3920#[cfg_attr(feature = "serde", serde(tag = "type"))]
3921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3922#[repr(u32)]
3923#[doc = "Yaw behaviour during orbit flight."]
3924pub enum OrbitYawBehaviour {
3925 #[doc = "Vehicle front points to the center (default)."]
3926 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3927 #[doc = "Vehicle front holds heading when message received."]
3928 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3929 #[doc = "Yaw uncontrolled."]
3930 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3931 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3932 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3933 #[doc = "Yaw controlled by RC input."]
3934 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3935 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3936 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3937}
3938impl OrbitYawBehaviour {
3939 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3940}
3941impl Default for OrbitYawBehaviour {
3942 fn default() -> Self {
3943 Self::DEFAULT
3944 }
3945}
3946#[cfg_attr(feature = "ts", derive(TS))]
3947#[cfg_attr(feature = "ts", ts(export))]
3948#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3949#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3950#[cfg_attr(feature = "serde", serde(tag = "type"))]
3951#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3952#[repr(u32)]
3953#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3954pub enum ParachuteAction {
3955 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3956 PARACHUTE_DISABLE = 0,
3957 #[doc = "Enable auto-release of parachute."]
3958 PARACHUTE_ENABLE = 1,
3959 #[doc = "Release parachute and kill motors."]
3960 PARACHUTE_RELEASE = 2,
3961}
3962impl ParachuteAction {
3963 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3964}
3965impl Default for ParachuteAction {
3966 fn default() -> Self {
3967 Self::DEFAULT
3968 }
3969}
3970#[cfg_attr(feature = "ts", derive(TS))]
3971#[cfg_attr(feature = "ts", ts(export))]
3972#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3973#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3974#[cfg_attr(feature = "serde", serde(tag = "type"))]
3975#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3976#[repr(u32)]
3977#[doc = "Result from PARAM_EXT_SET message."]
3978pub enum ParamAck {
3979 #[doc = "Parameter value ACCEPTED and SET"]
3980 PARAM_ACK_ACCEPTED = 0,
3981 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
3982 PARAM_ACK_VALUE_UNSUPPORTED = 1,
3983 #[doc = "Parameter failed to set"]
3984 PARAM_ACK_FAILED = 2,
3985 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
3986 PARAM_ACK_IN_PROGRESS = 3,
3987}
3988impl ParamAck {
3989 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
3990}
3991impl Default for ParamAck {
3992 fn default() -> Self {
3993 Self::DEFAULT
3994 }
3995}
3996bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
3997impl PositionTargetTypemask {
3998 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
3999}
4000impl Default for PositionTargetTypemask {
4001 fn default() -> Self {
4002 Self::DEFAULT
4003 }
4004}
4005#[cfg_attr(feature = "ts", derive(TS))]
4006#[cfg_attr(feature = "ts", ts(export))]
4007#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4008#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4009#[cfg_attr(feature = "serde", serde(tag = "type"))]
4010#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4011#[repr(u32)]
4012#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
4013pub enum PrecisionLandMode {
4014 #[doc = "Normal (non-precision) landing."]
4015 PRECISION_LAND_MODE_DISABLED = 0,
4016 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
4017 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
4018 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
4019 PRECISION_LAND_MODE_REQUIRED = 2,
4020}
4021impl PrecisionLandMode {
4022 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
4023}
4024impl Default for PrecisionLandMode {
4025 fn default() -> Self {
4026 Self::DEFAULT
4027 }
4028}
4029#[cfg_attr(feature = "ts", derive(TS))]
4030#[cfg_attr(feature = "ts", ts(export))]
4031#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4033#[cfg_attr(feature = "serde", serde(tag = "type"))]
4034#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4035#[repr(u32)]
4036#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4037pub enum PreflightStorageMissionAction {
4038 #[doc = "Read current mission data from persistent storage"]
4039 MISSION_READ_PERSISTENT = 0,
4040 #[doc = "Write current mission data to persistent storage"]
4041 MISSION_WRITE_PERSISTENT = 1,
4042 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
4043 MISSION_RESET_DEFAULT = 2,
4044}
4045impl PreflightStorageMissionAction {
4046 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
4047}
4048impl Default for PreflightStorageMissionAction {
4049 fn default() -> Self {
4050 Self::DEFAULT
4051 }
4052}
4053#[cfg_attr(feature = "ts", derive(TS))]
4054#[cfg_attr(feature = "ts", ts(export))]
4055#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4056#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4057#[cfg_attr(feature = "serde", serde(tag = "type"))]
4058#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4059#[repr(u32)]
4060#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4061pub enum PreflightStorageParameterAction {
4062 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
4063 PARAM_READ_PERSISTENT = 0,
4064 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
4065 PARAM_WRITE_PERSISTENT = 1,
4066 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
4067 PARAM_RESET_CONFIG_DEFAULT = 2,
4068 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
4069 PARAM_RESET_SENSOR_DEFAULT = 3,
4070 #[doc = "Reset all parameters, including operation counters, to default values"]
4071 PARAM_RESET_ALL_DEFAULT = 4,
4072}
4073impl PreflightStorageParameterAction {
4074 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
4075}
4076impl Default for PreflightStorageParameterAction {
4077 fn default() -> Self {
4078 Self::DEFAULT
4079 }
4080}
4081#[cfg_attr(feature = "ts", derive(TS))]
4082#[cfg_attr(feature = "ts", ts(export))]
4083#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4084#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4085#[cfg_attr(feature = "serde", serde(tag = "type"))]
4086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4087#[repr(u32)]
4088#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
4089pub enum RcSubType {
4090 #[doc = "Spektrum DSM2"]
4091 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
4092 #[doc = "Spektrum DSMX"]
4093 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
4094 #[doc = "Spektrum DSMX8"]
4095 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
4096}
4097impl RcSubType {
4098 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
4099}
4100impl Default for RcSubType {
4101 fn default() -> Self {
4102 Self::DEFAULT
4103 }
4104}
4105#[cfg_attr(feature = "ts", derive(TS))]
4106#[cfg_attr(feature = "ts", ts(export))]
4107#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4108#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4109#[cfg_attr(feature = "serde", serde(tag = "type"))]
4110#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4111#[repr(u32)]
4112#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
4113pub enum RcType {
4114 #[doc = "Spektrum"]
4115 RC_TYPE_SPEKTRUM = 0,
4116 #[doc = "CRSF"]
4117 RC_TYPE_CRSF = 1,
4118}
4119impl RcType {
4120 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
4121}
4122impl Default for RcType {
4123 fn default() -> Self {
4124 Self::DEFAULT
4125 }
4126}
4127#[cfg_attr(feature = "ts", derive(TS))]
4128#[cfg_attr(feature = "ts", ts(export))]
4129#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4131#[cfg_attr(feature = "serde", serde(tag = "type"))]
4132#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4133#[repr(u32)]
4134#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
4135pub enum RebootShutdownConditions {
4136 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
4137 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
4138 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
4139 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
4140}
4141impl RebootShutdownConditions {
4142 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
4143}
4144impl Default for RebootShutdownConditions {
4145 fn default() -> Self {
4146 Self::DEFAULT
4147 }
4148}
4149#[cfg_attr(feature = "ts", derive(TS))]
4150#[cfg_attr(feature = "ts", ts(export))]
4151#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4152#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4153#[cfg_attr(feature = "serde", serde(tag = "type"))]
4154#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4155#[repr(u32)]
4156#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
4157pub enum RtkBaselineCoordinateSystem {
4158 #[doc = "Earth-centered, Earth-fixed"]
4159 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
4160 #[doc = "RTK basestation centered, north, east, down"]
4161 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
4162}
4163impl RtkBaselineCoordinateSystem {
4164 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
4165}
4166impl Default for RtkBaselineCoordinateSystem {
4167 fn default() -> Self {
4168 Self::DEFAULT
4169 }
4170}
4171#[cfg_attr(feature = "ts", derive(TS))]
4172#[cfg_attr(feature = "ts", ts(export))]
4173#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4174#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4175#[cfg_attr(feature = "serde", serde(tag = "type"))]
4176#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4177#[repr(u32)]
4178#[doc = "Possible safety switch states."]
4179pub enum SafetySwitchState {
4180 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
4181 SAFETY_SWITCH_STATE_SAFE = 0,
4182 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
4183 SAFETY_SWITCH_STATE_DANGEROUS = 1,
4184}
4185impl SafetySwitchState {
4186 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
4187}
4188impl Default for SafetySwitchState {
4189 fn default() -> Self {
4190 Self::DEFAULT
4191 }
4192}
4193#[cfg_attr(feature = "ts", derive(TS))]
4194#[cfg_attr(feature = "ts", ts(export))]
4195#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4196#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4197#[cfg_attr(feature = "serde", serde(tag = "type"))]
4198#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4199#[repr(u32)]
4200#[doc = "SERIAL_CONTROL device types"]
4201pub enum SerialControlDev {
4202 #[doc = "First telemetry port"]
4203 SERIAL_CONTROL_DEV_TELEM1 = 0,
4204 #[doc = "Second telemetry port"]
4205 SERIAL_CONTROL_DEV_TELEM2 = 1,
4206 #[doc = "First GPS port"]
4207 SERIAL_CONTROL_DEV_GPS1 = 2,
4208 #[doc = "Second GPS port"]
4209 SERIAL_CONTROL_DEV_GPS2 = 3,
4210 #[doc = "system shell"]
4211 SERIAL_CONTROL_DEV_SHELL = 10,
4212 #[doc = "SERIAL0"]
4213 SERIAL_CONTROL_SERIAL0 = 100,
4214 #[doc = "SERIAL1"]
4215 SERIAL_CONTROL_SERIAL1 = 101,
4216 #[doc = "SERIAL2"]
4217 SERIAL_CONTROL_SERIAL2 = 102,
4218 #[doc = "SERIAL3"]
4219 SERIAL_CONTROL_SERIAL3 = 103,
4220 #[doc = "SERIAL4"]
4221 SERIAL_CONTROL_SERIAL4 = 104,
4222 #[doc = "SERIAL5"]
4223 SERIAL_CONTROL_SERIAL5 = 105,
4224 #[doc = "SERIAL6"]
4225 SERIAL_CONTROL_SERIAL6 = 106,
4226 #[doc = "SERIAL7"]
4227 SERIAL_CONTROL_SERIAL7 = 107,
4228 #[doc = "SERIAL8"]
4229 SERIAL_CONTROL_SERIAL8 = 108,
4230 #[doc = "SERIAL9"]
4231 SERIAL_CONTROL_SERIAL9 = 109,
4232}
4233impl SerialControlDev {
4234 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4235}
4236impl Default for SerialControlDev {
4237 fn default() -> Self {
4238 Self::DEFAULT
4239 }
4240}
4241bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4242impl SerialControlFlag {
4243 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4244}
4245impl Default for SerialControlFlag {
4246 fn default() -> Self {
4247 Self::DEFAULT
4248 }
4249}
4250#[cfg_attr(feature = "ts", derive(TS))]
4251#[cfg_attr(feature = "ts", ts(export))]
4252#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4253#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4254#[cfg_attr(feature = "serde", serde(tag = "type"))]
4255#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4256#[repr(u32)]
4257#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4258pub enum SetFocusType {
4259 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4260 FOCUS_TYPE_STEP = 0,
4261 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4262 FOCUS_TYPE_CONTINUOUS = 1,
4263 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4264 FOCUS_TYPE_RANGE = 2,
4265 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4266 FOCUS_TYPE_METERS = 3,
4267 #[doc = "Focus automatically."]
4268 FOCUS_TYPE_AUTO = 4,
4269 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4270 FOCUS_TYPE_AUTO_SINGLE = 5,
4271 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4272 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4273}
4274impl SetFocusType {
4275 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4276}
4277impl Default for SetFocusType {
4278 fn default() -> Self {
4279 Self::DEFAULT
4280 }
4281}
4282#[cfg_attr(feature = "ts", derive(TS))]
4283#[cfg_attr(feature = "ts", ts(export))]
4284#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4285#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4286#[cfg_attr(feature = "serde", serde(tag = "type"))]
4287#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4288#[repr(u32)]
4289#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4290pub enum SpeedType {
4291 #[doc = "Airspeed"]
4292 SPEED_TYPE_AIRSPEED = 0,
4293 #[doc = "Groundspeed"]
4294 SPEED_TYPE_GROUNDSPEED = 1,
4295 #[doc = "Climb speed"]
4296 SPEED_TYPE_CLIMB_SPEED = 2,
4297 #[doc = "Descent speed"]
4298 SPEED_TYPE_DESCENT_SPEED = 3,
4299}
4300impl SpeedType {
4301 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4302}
4303impl Default for SpeedType {
4304 fn default() -> Self {
4305 Self::DEFAULT
4306 }
4307}
4308#[cfg_attr(feature = "ts", derive(TS))]
4309#[cfg_attr(feature = "ts", ts(export))]
4310#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4312#[cfg_attr(feature = "serde", serde(tag = "type"))]
4313#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4314#[repr(u32)]
4315#[doc = "Flags to indicate the status of camera storage."]
4316pub enum StorageStatus {
4317 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4318 STORAGE_STATUS_EMPTY = 0,
4319 #[doc = "Storage present but unformatted."]
4320 STORAGE_STATUS_UNFORMATTED = 1,
4321 #[doc = "Storage present and ready."]
4322 STORAGE_STATUS_READY = 2,
4323 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4324 STORAGE_STATUS_NOT_SUPPORTED = 3,
4325}
4326impl StorageStatus {
4327 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4328}
4329impl Default for StorageStatus {
4330 fn default() -> Self {
4331 Self::DEFAULT
4332 }
4333}
4334#[cfg_attr(feature = "ts", derive(TS))]
4335#[cfg_attr(feature = "ts", ts(export))]
4336#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4337#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4338#[cfg_attr(feature = "serde", serde(tag = "type"))]
4339#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4340#[repr(u32)]
4341#[doc = "Flags to indicate the type of storage."]
4342pub enum StorageType {
4343 #[doc = "Storage type is not known."]
4344 STORAGE_TYPE_UNKNOWN = 0,
4345 #[doc = "Storage type is USB device."]
4346 STORAGE_TYPE_USB_STICK = 1,
4347 #[doc = "Storage type is SD card."]
4348 STORAGE_TYPE_SD = 2,
4349 #[doc = "Storage type is microSD card."]
4350 STORAGE_TYPE_MICROSD = 3,
4351 #[doc = "Storage type is CFast."]
4352 STORAGE_TYPE_CF = 4,
4353 #[doc = "Storage type is CFexpress."]
4354 STORAGE_TYPE_CFE = 5,
4355 #[doc = "Storage type is XQD."]
4356 STORAGE_TYPE_XQD = 6,
4357 #[doc = "Storage type is HD mass storage type."]
4358 STORAGE_TYPE_HD = 7,
4359 #[doc = "Storage type is other, not listed type."]
4360 STORAGE_TYPE_OTHER = 254,
4361}
4362impl StorageType {
4363 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4364}
4365impl Default for StorageType {
4366 fn default() -> Self {
4367 Self::DEFAULT
4368 }
4369}
4370bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4371impl StorageUsageFlag {
4372 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4373}
4374impl Default for StorageUsageFlag {
4375 fn default() -> Self {
4376 Self::DEFAULT
4377 }
4378}
4379#[cfg_attr(feature = "ts", derive(TS))]
4380#[cfg_attr(feature = "ts", ts(export))]
4381#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4383#[cfg_attr(feature = "serde", serde(tag = "type"))]
4384#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4385#[repr(u32)]
4386#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4387pub enum TuneFormat {
4388 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4389 TUNE_FORMAT_QBASIC1_1 = 1,
4390 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4391 TUNE_FORMAT_MML_MODERN = 2,
4392}
4393impl TuneFormat {
4394 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4395}
4396impl Default for TuneFormat {
4397 fn default() -> Self {
4398 Self::DEFAULT
4399 }
4400}
4401#[cfg_attr(feature = "ts", derive(TS))]
4402#[cfg_attr(feature = "ts", ts(export))]
4403#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4404#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4405#[cfg_attr(feature = "serde", serde(tag = "type"))]
4406#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4407#[repr(u32)]
4408#[doc = "Generalized UAVCAN node health"]
4409pub enum UavcanNodeHealth {
4410 #[doc = "The node is functioning properly."]
4411 UAVCAN_NODE_HEALTH_OK = 0,
4412 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4413 UAVCAN_NODE_HEALTH_WARNING = 1,
4414 #[doc = "The node has encountered a major failure."]
4415 UAVCAN_NODE_HEALTH_ERROR = 2,
4416 #[doc = "The node has suffered a fatal malfunction."]
4417 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4418}
4419impl UavcanNodeHealth {
4420 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4421}
4422impl Default for UavcanNodeHealth {
4423 fn default() -> Self {
4424 Self::DEFAULT
4425 }
4426}
4427#[cfg_attr(feature = "ts", derive(TS))]
4428#[cfg_attr(feature = "ts", ts(export))]
4429#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4430#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4431#[cfg_attr(feature = "serde", serde(tag = "type"))]
4432#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4433#[repr(u32)]
4434#[doc = "Generalized UAVCAN node mode"]
4435pub enum UavcanNodeMode {
4436 #[doc = "The node is performing its primary functions."]
4437 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4438 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4439 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4440 #[doc = "The node is under maintenance."]
4441 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4442 #[doc = "The node is in the process of updating its software."]
4443 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4444 #[doc = "The node is no longer available online."]
4445 UAVCAN_NODE_MODE_OFFLINE = 7,
4446}
4447impl UavcanNodeMode {
4448 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4449}
4450impl Default for UavcanNodeMode {
4451 fn default() -> Self {
4452 Self::DEFAULT
4453 }
4454}
4455bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4456impl UtmDataAvailFlags {
4457 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4458}
4459impl Default for UtmDataAvailFlags {
4460 fn default() -> Self {
4461 Self::DEFAULT
4462 }
4463}
4464#[cfg_attr(feature = "ts", derive(TS))]
4465#[cfg_attr(feature = "ts", ts(export))]
4466#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4467#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4468#[cfg_attr(feature = "serde", serde(tag = "type"))]
4469#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4470#[repr(u32)]
4471#[doc = "Airborne status of UAS."]
4472pub enum UtmFlightState {
4473 #[doc = "The flight state can't be determined."]
4474 UTM_FLIGHT_STATE_UNKNOWN = 1,
4475 #[doc = "UAS on ground."]
4476 UTM_FLIGHT_STATE_GROUND = 2,
4477 #[doc = "UAS airborne."]
4478 UTM_FLIGHT_STATE_AIRBORNE = 3,
4479 #[doc = "UAS is in an emergency flight state."]
4480 UTM_FLIGHT_STATE_EMERGENCY = 16,
4481 #[doc = "UAS has no active controls."]
4482 UTM_FLIGHT_STATE_NOCTRL = 32,
4483}
4484impl UtmFlightState {
4485 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4486}
4487impl Default for UtmFlightState {
4488 fn default() -> Self {
4489 Self::DEFAULT
4490 }
4491}
4492#[cfg_attr(feature = "ts", derive(TS))]
4493#[cfg_attr(feature = "ts", ts(export))]
4494#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4495#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4496#[cfg_attr(feature = "serde", serde(tag = "type"))]
4497#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4498#[repr(u32)]
4499#[doc = "Video stream encodings"]
4500pub enum VideoStreamEncoding {
4501 #[doc = "Stream encoding is unknown"]
4502 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4503 #[doc = "Stream encoding is H.264"]
4504 VIDEO_STREAM_ENCODING_H264 = 1,
4505 #[doc = "Stream encoding is H.265"]
4506 VIDEO_STREAM_ENCODING_H265 = 2,
4507}
4508impl VideoStreamEncoding {
4509 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4510}
4511impl Default for VideoStreamEncoding {
4512 fn default() -> Self {
4513 Self::DEFAULT
4514 }
4515}
4516bitflags! { # [cfg_attr (feature = "ts" , derive (TS))] # [cfg_attr (feature = "ts" , ts (export , type = "number"))] # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4517impl VideoStreamStatusFlags {
4518 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4519}
4520impl Default for VideoStreamStatusFlags {
4521 fn default() -> Self {
4522 Self::DEFAULT
4523 }
4524}
4525#[cfg_attr(feature = "ts", derive(TS))]
4526#[cfg_attr(feature = "ts", ts(export))]
4527#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4528#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4529#[cfg_attr(feature = "serde", serde(tag = "type"))]
4530#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4531#[repr(u32)]
4532#[doc = "Video stream types"]
4533pub enum VideoStreamType {
4534 #[doc = "Stream is RTSP"]
4535 VIDEO_STREAM_TYPE_RTSP = 0,
4536 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4537 VIDEO_STREAM_TYPE_RTPUDP = 1,
4538 #[doc = "Stream is MPEG on TCP"]
4539 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4540 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4541 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4542}
4543impl VideoStreamType {
4544 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4545}
4546impl Default for VideoStreamType {
4547 fn default() -> Self {
4548 Self::DEFAULT
4549 }
4550}
4551#[cfg_attr(feature = "ts", derive(TS))]
4552#[cfg_attr(feature = "ts", ts(export))]
4553#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4554#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4555#[cfg_attr(feature = "serde", serde(tag = "type"))]
4556#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4557#[repr(u32)]
4558#[doc = "Direction of VTOL transition"]
4559pub enum VtolTransitionHeading {
4560 #[doc = "Respect the heading configuration of the vehicle."]
4561 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4562 #[doc = "Use the heading pointing towards the next waypoint."]
4563 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4564 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4565 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4566 #[doc = "Use the specified heading in parameter 4."]
4567 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4568 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4569 VTOL_TRANSITION_HEADING_ANY = 4,
4570}
4571impl VtolTransitionHeading {
4572 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4573}
4574impl Default for VtolTransitionHeading {
4575 fn default() -> Self {
4576 Self::DEFAULT
4577 }
4578}
4579#[cfg_attr(feature = "ts", derive(TS))]
4580#[cfg_attr(feature = "ts", ts(export))]
4581#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4582#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4583#[cfg_attr(feature = "serde", serde(tag = "type"))]
4584#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4585#[repr(u32)]
4586#[doc = "WiFi Mode."]
4587pub enum WifiConfigApMode {
4588 #[doc = "WiFi mode is undefined."]
4589 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4590 #[doc = "WiFi configured as an access point."]
4591 WIFI_CONFIG_AP_MODE_AP = 1,
4592 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4593 WIFI_CONFIG_AP_MODE_STATION = 2,
4594 #[doc = "WiFi disabled."]
4595 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4596}
4597impl WifiConfigApMode {
4598 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4599}
4600impl Default for WifiConfigApMode {
4601 fn default() -> Self {
4602 Self::DEFAULT
4603 }
4604}
4605#[cfg_attr(feature = "ts", derive(TS))]
4606#[cfg_attr(feature = "ts", ts(export))]
4607#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4608#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4609#[cfg_attr(feature = "serde", serde(tag = "type"))]
4610#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4611#[repr(u32)]
4612#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4613pub enum WifiConfigApResponse {
4614 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4615 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4616 #[doc = "Changes accepted."]
4617 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4618 #[doc = "Changes rejected."]
4619 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4620 #[doc = "Invalid Mode."]
4621 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4622 #[doc = "Invalid SSID."]
4623 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4624 #[doc = "Invalid Password."]
4625 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4626}
4627impl WifiConfigApResponse {
4628 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4629}
4630impl Default for WifiConfigApResponse {
4631 fn default() -> Self {
4632 Self::DEFAULT
4633 }
4634}
4635#[cfg_attr(feature = "ts", derive(TS))]
4636#[cfg_attr(feature = "ts", ts(export))]
4637#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4638#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4639#[cfg_attr(feature = "serde", serde(tag = "type"))]
4640#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4641#[repr(u32)]
4642#[doc = "Winch actions."]
4643pub enum WinchActions {
4644 #[doc = "Allow motor to freewheel."]
4645 WINCH_RELAXED = 0,
4646 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4647 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4648 #[doc = "Wind or unwind line at specified rate."]
4649 WINCH_RATE_CONTROL = 2,
4650 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4651 WINCH_LOCK = 3,
4652 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4653 WINCH_DELIVER = 4,
4654 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4655 WINCH_HOLD = 5,
4656 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4657 WINCH_RETRACT = 6,
4658 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4659 WINCH_LOAD_LINE = 7,
4660 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4661 WINCH_ABANDON_LINE = 8,
4662 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4663 WINCH_LOAD_PAYLOAD = 9,
4664}
4665impl WinchActions {
4666 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4667}
4668impl Default for WinchActions {
4669 fn default() -> Self {
4670 Self::DEFAULT
4671 }
4672}
4673#[doc = "Set the vehicle attitude and body angular rates."]
4674#[doc = ""]
4675#[doc = "ID: 140"]
4676#[derive(Debug, Clone, PartialEq)]
4677#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4678#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4679#[cfg_attr(feature = "ts", derive(TS))]
4680#[cfg_attr(feature = "ts", ts(export))]
4681pub struct ACTUATOR_CONTROL_TARGET_DATA {
4682 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4683 pub time_usec: u64,
4684 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4685 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4686 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4687 pub controls: [f32; 8],
4688 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4689 pub group_mlx: u8,
4690}
4691impl ACTUATOR_CONTROL_TARGET_DATA {
4692 pub const ENCODED_LEN: usize = 41usize;
4693 pub const DEFAULT: Self = Self {
4694 time_usec: 0_u64,
4695 controls: [0.0_f32; 8usize],
4696 group_mlx: 0_u8,
4697 };
4698 #[cfg(feature = "arbitrary")]
4699 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4700 use arbitrary::{Arbitrary, Unstructured};
4701 let mut buf = [0u8; 1024];
4702 rng.fill_bytes(&mut buf);
4703 let mut unstructured = Unstructured::new(&buf);
4704 Self::arbitrary(&mut unstructured).unwrap_or_default()
4705 }
4706}
4707impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4708 fn default() -> Self {
4709 Self::DEFAULT.clone()
4710 }
4711}
4712impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4713 type Message = MavMessage;
4714 const ID: u32 = 140u32;
4715 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4716 const EXTRA_CRC: u8 = 181u8;
4717 const ENCODED_LEN: usize = 41usize;
4718 fn deser(
4719 _version: MavlinkVersion,
4720 __input: &[u8],
4721 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4722 let avail_len = __input.len();
4723 let mut payload_buf = [0; Self::ENCODED_LEN];
4724 let mut buf = if avail_len < Self::ENCODED_LEN {
4725 payload_buf[0..avail_len].copy_from_slice(__input);
4726 Bytes::new(&payload_buf)
4727 } else {
4728 Bytes::new(__input)
4729 };
4730 let mut __struct = Self::default();
4731 __struct.time_usec = buf.get_u64_le()?;
4732 for v in &mut __struct.controls {
4733 let val = buf.get_f32_le()?;
4734 *v = val;
4735 }
4736 __struct.group_mlx = buf.get_u8()?;
4737 Ok(__struct)
4738 }
4739 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4740 let mut __tmp = BytesMut::new(bytes);
4741 #[allow(clippy::absurd_extreme_comparisons)]
4742 #[allow(unused_comparisons)]
4743 if __tmp.remaining() < Self::ENCODED_LEN {
4744 panic!(
4745 "buffer is too small (need {} bytes, but got {})",
4746 Self::ENCODED_LEN,
4747 __tmp.remaining(),
4748 )
4749 }
4750 __tmp.put_u64_le(self.time_usec);
4751 for val in &self.controls {
4752 __tmp.put_f32_le(*val);
4753 }
4754 __tmp.put_u8(self.group_mlx);
4755 if matches!(version, MavlinkVersion::V2) {
4756 let len = __tmp.len();
4757 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4758 } else {
4759 __tmp.len()
4760 }
4761 }
4762}
4763#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4764#[doc = ""]
4765#[doc = "ID: 375"]
4766#[derive(Debug, Clone, PartialEq)]
4767#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4768#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4769#[cfg_attr(feature = "ts", derive(TS))]
4770#[cfg_attr(feature = "ts", ts(export))]
4771pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4772 #[doc = "Timestamp (since system boot)."]
4773 pub time_usec: u64,
4774 #[doc = "Active outputs"]
4775 pub active: u32,
4776 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4777 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4778 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
4779 pub actuator: [f32; 32],
4780}
4781impl ACTUATOR_OUTPUT_STATUS_DATA {
4782 pub const ENCODED_LEN: usize = 140usize;
4783 pub const DEFAULT: Self = Self {
4784 time_usec: 0_u64,
4785 active: 0_u32,
4786 actuator: [0.0_f32; 32usize],
4787 };
4788 #[cfg(feature = "arbitrary")]
4789 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4790 use arbitrary::{Arbitrary, Unstructured};
4791 let mut buf = [0u8; 1024];
4792 rng.fill_bytes(&mut buf);
4793 let mut unstructured = Unstructured::new(&buf);
4794 Self::arbitrary(&mut unstructured).unwrap_or_default()
4795 }
4796}
4797impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4798 fn default() -> Self {
4799 Self::DEFAULT.clone()
4800 }
4801}
4802impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4803 type Message = MavMessage;
4804 const ID: u32 = 375u32;
4805 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4806 const EXTRA_CRC: u8 = 251u8;
4807 const ENCODED_LEN: usize = 140usize;
4808 fn deser(
4809 _version: MavlinkVersion,
4810 __input: &[u8],
4811 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4812 let avail_len = __input.len();
4813 let mut payload_buf = [0; Self::ENCODED_LEN];
4814 let mut buf = if avail_len < Self::ENCODED_LEN {
4815 payload_buf[0..avail_len].copy_from_slice(__input);
4816 Bytes::new(&payload_buf)
4817 } else {
4818 Bytes::new(__input)
4819 };
4820 let mut __struct = Self::default();
4821 __struct.time_usec = buf.get_u64_le()?;
4822 __struct.active = buf.get_u32_le()?;
4823 for v in &mut __struct.actuator {
4824 let val = buf.get_f32_le()?;
4825 *v = val;
4826 }
4827 Ok(__struct)
4828 }
4829 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4830 let mut __tmp = BytesMut::new(bytes);
4831 #[allow(clippy::absurd_extreme_comparisons)]
4832 #[allow(unused_comparisons)]
4833 if __tmp.remaining() < Self::ENCODED_LEN {
4834 panic!(
4835 "buffer is too small (need {} bytes, but got {})",
4836 Self::ENCODED_LEN,
4837 __tmp.remaining(),
4838 )
4839 }
4840 __tmp.put_u64_le(self.time_usec);
4841 __tmp.put_u32_le(self.active);
4842 for val in &self.actuator {
4843 __tmp.put_f32_le(*val);
4844 }
4845 if matches!(version, MavlinkVersion::V2) {
4846 let len = __tmp.len();
4847 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4848 } else {
4849 __tmp.len()
4850 }
4851 }
4852}
4853#[doc = "The location and information of an ADSB vehicle."]
4854#[doc = ""]
4855#[doc = "ID: 246"]
4856#[derive(Debug, Clone, PartialEq)]
4857#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4858#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4859#[cfg_attr(feature = "ts", derive(TS))]
4860#[cfg_attr(feature = "ts", ts(export))]
4861pub struct ADSB_VEHICLE_DATA {
4862 #[doc = "ICAO address"]
4863 pub ICAO_address: u32,
4864 #[doc = "Latitude"]
4865 pub lat: i32,
4866 #[doc = "Longitude"]
4867 pub lon: i32,
4868 #[doc = "Altitude(ASL)"]
4869 pub altitude: i32,
4870 #[doc = "Course over ground"]
4871 pub heading: u16,
4872 #[doc = "The horizontal velocity"]
4873 pub hor_velocity: u16,
4874 #[doc = "The vertical velocity. Positive is up"]
4875 pub ver_velocity: i16,
4876 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4877 pub flags: AdsbFlags,
4878 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4879 pub squawk: u16,
4880 #[doc = "ADSB altitude type."]
4881 pub altitude_type: AdsbAltitudeType,
4882 #[doc = "The callsign, 8+null"]
4883 #[cfg_attr(feature = "ts", ts(type = "string"))]
4884 pub callsign: CharArray<9>,
4885 #[doc = "ADSB emitter type."]
4886 pub emitter_type: AdsbEmitterType,
4887 #[doc = "Time since last communication in seconds"]
4888 pub tslc: u8,
4889}
4890impl ADSB_VEHICLE_DATA {
4891 pub const ENCODED_LEN: usize = 38usize;
4892 pub const DEFAULT: Self = Self {
4893 ICAO_address: 0_u32,
4894 lat: 0_i32,
4895 lon: 0_i32,
4896 altitude: 0_i32,
4897 heading: 0_u16,
4898 hor_velocity: 0_u16,
4899 ver_velocity: 0_i16,
4900 flags: AdsbFlags::DEFAULT,
4901 squawk: 0_u16,
4902 altitude_type: AdsbAltitudeType::DEFAULT,
4903 callsign: CharArray::new([0_u8; 9usize]),
4904 emitter_type: AdsbEmitterType::DEFAULT,
4905 tslc: 0_u8,
4906 };
4907 #[cfg(feature = "arbitrary")]
4908 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4909 use arbitrary::{Arbitrary, Unstructured};
4910 let mut buf = [0u8; 1024];
4911 rng.fill_bytes(&mut buf);
4912 let mut unstructured = Unstructured::new(&buf);
4913 Self::arbitrary(&mut unstructured).unwrap_or_default()
4914 }
4915}
4916impl Default for ADSB_VEHICLE_DATA {
4917 fn default() -> Self {
4918 Self::DEFAULT.clone()
4919 }
4920}
4921impl MessageData for ADSB_VEHICLE_DATA {
4922 type Message = MavMessage;
4923 const ID: u32 = 246u32;
4924 const NAME: &'static str = "ADSB_VEHICLE";
4925 const EXTRA_CRC: u8 = 184u8;
4926 const ENCODED_LEN: usize = 38usize;
4927 fn deser(
4928 _version: MavlinkVersion,
4929 __input: &[u8],
4930 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4931 let avail_len = __input.len();
4932 let mut payload_buf = [0; Self::ENCODED_LEN];
4933 let mut buf = if avail_len < Self::ENCODED_LEN {
4934 payload_buf[0..avail_len].copy_from_slice(__input);
4935 Bytes::new(&payload_buf)
4936 } else {
4937 Bytes::new(__input)
4938 };
4939 let mut __struct = Self::default();
4940 __struct.ICAO_address = buf.get_u32_le()?;
4941 __struct.lat = buf.get_i32_le()?;
4942 __struct.lon = buf.get_i32_le()?;
4943 __struct.altitude = buf.get_i32_le()?;
4944 __struct.heading = buf.get_u16_le()?;
4945 __struct.hor_velocity = buf.get_u16_le()?;
4946 __struct.ver_velocity = buf.get_i16_le()?;
4947 let tmp = buf.get_u16_le()?;
4948 __struct.flags = AdsbFlags::from_bits(tmp as <AdsbFlags as Flags>::Bits).ok_or(
4949 ::mavlink_core::error::ParserError::InvalidFlag {
4950 flag_type: "AdsbFlags",
4951 value: tmp as u64,
4952 },
4953 )?;
4954 __struct.squawk = buf.get_u16_le()?;
4955 let tmp = buf.get_u8()?;
4956 __struct.altitude_type =
4957 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4958 enum_type: "AdsbAltitudeType",
4959 value: tmp as u64,
4960 })?;
4961 let mut tmp = [0_u8; 9usize];
4962 for v in &mut tmp {
4963 *v = buf.get_u8()?;
4964 }
4965 __struct.callsign = CharArray::new(tmp);
4966 let tmp = buf.get_u8()?;
4967 __struct.emitter_type =
4968 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4969 enum_type: "AdsbEmitterType",
4970 value: tmp as u64,
4971 })?;
4972 __struct.tslc = buf.get_u8()?;
4973 Ok(__struct)
4974 }
4975 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4976 let mut __tmp = BytesMut::new(bytes);
4977 #[allow(clippy::absurd_extreme_comparisons)]
4978 #[allow(unused_comparisons)]
4979 if __tmp.remaining() < Self::ENCODED_LEN {
4980 panic!(
4981 "buffer is too small (need {} bytes, but got {})",
4982 Self::ENCODED_LEN,
4983 __tmp.remaining(),
4984 )
4985 }
4986 __tmp.put_u32_le(self.ICAO_address);
4987 __tmp.put_i32_le(self.lat);
4988 __tmp.put_i32_le(self.lon);
4989 __tmp.put_i32_le(self.altitude);
4990 __tmp.put_u16_le(self.heading);
4991 __tmp.put_u16_le(self.hor_velocity);
4992 __tmp.put_i16_le(self.ver_velocity);
4993 __tmp.put_u16_le(self.flags.bits() as u16);
4994 __tmp.put_u16_le(self.squawk);
4995 __tmp.put_u8(self.altitude_type as u8);
4996 for val in &self.callsign {
4997 __tmp.put_u8(*val);
4998 }
4999 __tmp.put_u8(self.emitter_type as u8);
5000 __tmp.put_u8(self.tslc);
5001 if matches!(version, MavlinkVersion::V2) {
5002 let len = __tmp.len();
5003 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5004 } else {
5005 __tmp.len()
5006 }
5007 }
5008}
5009#[doc = "The location and information of an AIS vessel."]
5010#[doc = ""]
5011#[doc = "ID: 301"]
5012#[derive(Debug, Clone, PartialEq)]
5013#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5014#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5015#[cfg_attr(feature = "ts", derive(TS))]
5016#[cfg_attr(feature = "ts", ts(export))]
5017pub struct AIS_VESSEL_DATA {
5018 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
5019 pub MMSI: u32,
5020 #[doc = "Latitude"]
5021 pub lat: i32,
5022 #[doc = "Longitude"]
5023 pub lon: i32,
5024 #[doc = "Course over ground"]
5025 pub COG: u16,
5026 #[doc = "True heading"]
5027 pub heading: u16,
5028 #[doc = "Speed over ground"]
5029 pub velocity: u16,
5030 #[doc = "Distance from lat/lon location to bow"]
5031 pub dimension_bow: u16,
5032 #[doc = "Distance from lat/lon location to stern"]
5033 pub dimension_stern: u16,
5034 #[doc = "Time since last communication in seconds"]
5035 pub tslc: u16,
5036 #[doc = "Bitmask to indicate various statuses including valid data fields"]
5037 pub flags: AisFlags,
5038 #[doc = "Turn rate"]
5039 pub turn_rate: i8,
5040 #[doc = "Navigational status"]
5041 pub navigational_status: AisNavStatus,
5042 #[doc = "Type of vessels"]
5043 pub mavtype: AisType,
5044 #[doc = "Distance from lat/lon location to port side"]
5045 pub dimension_port: u8,
5046 #[doc = "Distance from lat/lon location to starboard side"]
5047 pub dimension_starboard: u8,
5048 #[doc = "The vessel callsign"]
5049 #[cfg_attr(feature = "ts", ts(type = "string"))]
5050 pub callsign: CharArray<7>,
5051 #[doc = "The vessel name"]
5052 #[cfg_attr(feature = "ts", ts(type = "string"))]
5053 pub name: CharArray<20>,
5054}
5055impl AIS_VESSEL_DATA {
5056 pub const ENCODED_LEN: usize = 58usize;
5057 pub const DEFAULT: Self = Self {
5058 MMSI: 0_u32,
5059 lat: 0_i32,
5060 lon: 0_i32,
5061 COG: 0_u16,
5062 heading: 0_u16,
5063 velocity: 0_u16,
5064 dimension_bow: 0_u16,
5065 dimension_stern: 0_u16,
5066 tslc: 0_u16,
5067 flags: AisFlags::DEFAULT,
5068 turn_rate: 0_i8,
5069 navigational_status: AisNavStatus::DEFAULT,
5070 mavtype: AisType::DEFAULT,
5071 dimension_port: 0_u8,
5072 dimension_starboard: 0_u8,
5073 callsign: CharArray::new([0_u8; 7usize]),
5074 name: CharArray::new([0_u8; 20usize]),
5075 };
5076 #[cfg(feature = "arbitrary")]
5077 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5078 use arbitrary::{Arbitrary, Unstructured};
5079 let mut buf = [0u8; 1024];
5080 rng.fill_bytes(&mut buf);
5081 let mut unstructured = Unstructured::new(&buf);
5082 Self::arbitrary(&mut unstructured).unwrap_or_default()
5083 }
5084}
5085impl Default for AIS_VESSEL_DATA {
5086 fn default() -> Self {
5087 Self::DEFAULT.clone()
5088 }
5089}
5090impl MessageData for AIS_VESSEL_DATA {
5091 type Message = MavMessage;
5092 const ID: u32 = 301u32;
5093 const NAME: &'static str = "AIS_VESSEL";
5094 const EXTRA_CRC: u8 = 243u8;
5095 const ENCODED_LEN: usize = 58usize;
5096 fn deser(
5097 _version: MavlinkVersion,
5098 __input: &[u8],
5099 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5100 let avail_len = __input.len();
5101 let mut payload_buf = [0; Self::ENCODED_LEN];
5102 let mut buf = if avail_len < Self::ENCODED_LEN {
5103 payload_buf[0..avail_len].copy_from_slice(__input);
5104 Bytes::new(&payload_buf)
5105 } else {
5106 Bytes::new(__input)
5107 };
5108 let mut __struct = Self::default();
5109 __struct.MMSI = buf.get_u32_le()?;
5110 __struct.lat = buf.get_i32_le()?;
5111 __struct.lon = buf.get_i32_le()?;
5112 __struct.COG = buf.get_u16_le()?;
5113 __struct.heading = buf.get_u16_le()?;
5114 __struct.velocity = buf.get_u16_le()?;
5115 __struct.dimension_bow = buf.get_u16_le()?;
5116 __struct.dimension_stern = buf.get_u16_le()?;
5117 __struct.tslc = buf.get_u16_le()?;
5118 let tmp = buf.get_u16_le()?;
5119 __struct.flags = AisFlags::from_bits(tmp as <AisFlags as Flags>::Bits).ok_or(
5120 ::mavlink_core::error::ParserError::InvalidFlag {
5121 flag_type: "AisFlags",
5122 value: tmp as u64,
5123 },
5124 )?;
5125 __struct.turn_rate = buf.get_i8()?;
5126 let tmp = buf.get_u8()?;
5127 __struct.navigational_status =
5128 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5129 enum_type: "AisNavStatus",
5130 value: tmp as u64,
5131 })?;
5132 let tmp = buf.get_u8()?;
5133 __struct.mavtype =
5134 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5135 enum_type: "AisType",
5136 value: tmp as u64,
5137 })?;
5138 __struct.dimension_port = buf.get_u8()?;
5139 __struct.dimension_starboard = buf.get_u8()?;
5140 let mut tmp = [0_u8; 7usize];
5141 for v in &mut tmp {
5142 *v = buf.get_u8()?;
5143 }
5144 __struct.callsign = CharArray::new(tmp);
5145 let mut tmp = [0_u8; 20usize];
5146 for v in &mut tmp {
5147 *v = buf.get_u8()?;
5148 }
5149 __struct.name = CharArray::new(tmp);
5150 Ok(__struct)
5151 }
5152 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5153 let mut __tmp = BytesMut::new(bytes);
5154 #[allow(clippy::absurd_extreme_comparisons)]
5155 #[allow(unused_comparisons)]
5156 if __tmp.remaining() < Self::ENCODED_LEN {
5157 panic!(
5158 "buffer is too small (need {} bytes, but got {})",
5159 Self::ENCODED_LEN,
5160 __tmp.remaining(),
5161 )
5162 }
5163 __tmp.put_u32_le(self.MMSI);
5164 __tmp.put_i32_le(self.lat);
5165 __tmp.put_i32_le(self.lon);
5166 __tmp.put_u16_le(self.COG);
5167 __tmp.put_u16_le(self.heading);
5168 __tmp.put_u16_le(self.velocity);
5169 __tmp.put_u16_le(self.dimension_bow);
5170 __tmp.put_u16_le(self.dimension_stern);
5171 __tmp.put_u16_le(self.tslc);
5172 __tmp.put_u16_le(self.flags.bits() as u16);
5173 __tmp.put_i8(self.turn_rate);
5174 __tmp.put_u8(self.navigational_status as u8);
5175 __tmp.put_u8(self.mavtype as u8);
5176 __tmp.put_u8(self.dimension_port);
5177 __tmp.put_u8(self.dimension_starboard);
5178 for val in &self.callsign {
5179 __tmp.put_u8(*val);
5180 }
5181 for val in &self.name {
5182 __tmp.put_u8(*val);
5183 }
5184 if matches!(version, MavlinkVersion::V2) {
5185 let len = __tmp.len();
5186 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5187 } else {
5188 __tmp.len()
5189 }
5190 }
5191}
5192#[doc = "The current system altitude."]
5193#[doc = ""]
5194#[doc = "ID: 141"]
5195#[derive(Debug, Clone, PartialEq)]
5196#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5197#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5198#[cfg_attr(feature = "ts", derive(TS))]
5199#[cfg_attr(feature = "ts", ts(export))]
5200pub struct ALTITUDE_DATA {
5201 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5202 pub time_usec: u64,
5203 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
5204 pub altitude_monotonic: f32,
5205 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
5206 pub altitude_amsl: f32,
5207 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
5208 pub altitude_local: f32,
5209 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
5210 pub altitude_relative: f32,
5211 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
5212 pub altitude_terrain: f32,
5213 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
5214 pub bottom_clearance: f32,
5215}
5216impl ALTITUDE_DATA {
5217 pub const ENCODED_LEN: usize = 32usize;
5218 pub const DEFAULT: Self = Self {
5219 time_usec: 0_u64,
5220 altitude_monotonic: 0.0_f32,
5221 altitude_amsl: 0.0_f32,
5222 altitude_local: 0.0_f32,
5223 altitude_relative: 0.0_f32,
5224 altitude_terrain: 0.0_f32,
5225 bottom_clearance: 0.0_f32,
5226 };
5227 #[cfg(feature = "arbitrary")]
5228 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5229 use arbitrary::{Arbitrary, Unstructured};
5230 let mut buf = [0u8; 1024];
5231 rng.fill_bytes(&mut buf);
5232 let mut unstructured = Unstructured::new(&buf);
5233 Self::arbitrary(&mut unstructured).unwrap_or_default()
5234 }
5235}
5236impl Default for ALTITUDE_DATA {
5237 fn default() -> Self {
5238 Self::DEFAULT.clone()
5239 }
5240}
5241impl MessageData for ALTITUDE_DATA {
5242 type Message = MavMessage;
5243 const ID: u32 = 141u32;
5244 const NAME: &'static str = "ALTITUDE";
5245 const EXTRA_CRC: u8 = 47u8;
5246 const ENCODED_LEN: usize = 32usize;
5247 fn deser(
5248 _version: MavlinkVersion,
5249 __input: &[u8],
5250 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5251 let avail_len = __input.len();
5252 let mut payload_buf = [0; Self::ENCODED_LEN];
5253 let mut buf = if avail_len < Self::ENCODED_LEN {
5254 payload_buf[0..avail_len].copy_from_slice(__input);
5255 Bytes::new(&payload_buf)
5256 } else {
5257 Bytes::new(__input)
5258 };
5259 let mut __struct = Self::default();
5260 __struct.time_usec = buf.get_u64_le()?;
5261 __struct.altitude_monotonic = buf.get_f32_le()?;
5262 __struct.altitude_amsl = buf.get_f32_le()?;
5263 __struct.altitude_local = buf.get_f32_le()?;
5264 __struct.altitude_relative = buf.get_f32_le()?;
5265 __struct.altitude_terrain = buf.get_f32_le()?;
5266 __struct.bottom_clearance = buf.get_f32_le()?;
5267 Ok(__struct)
5268 }
5269 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5270 let mut __tmp = BytesMut::new(bytes);
5271 #[allow(clippy::absurd_extreme_comparisons)]
5272 #[allow(unused_comparisons)]
5273 if __tmp.remaining() < Self::ENCODED_LEN {
5274 panic!(
5275 "buffer is too small (need {} bytes, but got {})",
5276 Self::ENCODED_LEN,
5277 __tmp.remaining(),
5278 )
5279 }
5280 __tmp.put_u64_le(self.time_usec);
5281 __tmp.put_f32_le(self.altitude_monotonic);
5282 __tmp.put_f32_le(self.altitude_amsl);
5283 __tmp.put_f32_le(self.altitude_local);
5284 __tmp.put_f32_le(self.altitude_relative);
5285 __tmp.put_f32_le(self.altitude_terrain);
5286 __tmp.put_f32_le(self.bottom_clearance);
5287 if matches!(version, MavlinkVersion::V2) {
5288 let len = __tmp.len();
5289 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5290 } else {
5291 __tmp.len()
5292 }
5293 }
5294}
5295#[doc = "Array test #0."]
5296#[doc = ""]
5297#[doc = "ID: 17150"]
5298#[derive(Debug, Clone, PartialEq)]
5299#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5300#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5301#[cfg_attr(feature = "ts", derive(TS))]
5302#[cfg_attr(feature = "ts", ts(export))]
5303pub struct ARRAY_TEST_0_DATA {
5304 #[doc = "Value array"]
5305 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5306 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5307 pub ar_u32: [u32; 4],
5308 #[doc = "Value array"]
5309 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5310 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5311 pub ar_u16: [u16; 4],
5312 #[doc = "Stub field"]
5313 pub v1: u8,
5314 #[doc = "Value array"]
5315 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5316 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5317 pub ar_i8: [i8; 4],
5318 #[doc = "Value array"]
5319 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5320 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5321 pub ar_u8: [u8; 4],
5322}
5323impl ARRAY_TEST_0_DATA {
5324 pub const ENCODED_LEN: usize = 33usize;
5325 pub const DEFAULT: Self = Self {
5326 ar_u32: [0_u32; 4usize],
5327 ar_u16: [0_u16; 4usize],
5328 v1: 0_u8,
5329 ar_i8: [0_i8; 4usize],
5330 ar_u8: [0_u8; 4usize],
5331 };
5332 #[cfg(feature = "arbitrary")]
5333 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5334 use arbitrary::{Arbitrary, Unstructured};
5335 let mut buf = [0u8; 1024];
5336 rng.fill_bytes(&mut buf);
5337 let mut unstructured = Unstructured::new(&buf);
5338 Self::arbitrary(&mut unstructured).unwrap_or_default()
5339 }
5340}
5341impl Default for ARRAY_TEST_0_DATA {
5342 fn default() -> Self {
5343 Self::DEFAULT.clone()
5344 }
5345}
5346impl MessageData for ARRAY_TEST_0_DATA {
5347 type Message = MavMessage;
5348 const ID: u32 = 17150u32;
5349 const NAME: &'static str = "ARRAY_TEST_0";
5350 const EXTRA_CRC: u8 = 26u8;
5351 const ENCODED_LEN: usize = 33usize;
5352 fn deser(
5353 _version: MavlinkVersion,
5354 __input: &[u8],
5355 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5356 let avail_len = __input.len();
5357 let mut payload_buf = [0; Self::ENCODED_LEN];
5358 let mut buf = if avail_len < Self::ENCODED_LEN {
5359 payload_buf[0..avail_len].copy_from_slice(__input);
5360 Bytes::new(&payload_buf)
5361 } else {
5362 Bytes::new(__input)
5363 };
5364 let mut __struct = Self::default();
5365 for v in &mut __struct.ar_u32 {
5366 let val = buf.get_u32_le()?;
5367 *v = val;
5368 }
5369 for v in &mut __struct.ar_u16 {
5370 let val = buf.get_u16_le()?;
5371 *v = val;
5372 }
5373 __struct.v1 = buf.get_u8()?;
5374 for v in &mut __struct.ar_i8 {
5375 let val = buf.get_i8()?;
5376 *v = val;
5377 }
5378 for v in &mut __struct.ar_u8 {
5379 let val = buf.get_u8()?;
5380 *v = val;
5381 }
5382 Ok(__struct)
5383 }
5384 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5385 let mut __tmp = BytesMut::new(bytes);
5386 #[allow(clippy::absurd_extreme_comparisons)]
5387 #[allow(unused_comparisons)]
5388 if __tmp.remaining() < Self::ENCODED_LEN {
5389 panic!(
5390 "buffer is too small (need {} bytes, but got {})",
5391 Self::ENCODED_LEN,
5392 __tmp.remaining(),
5393 )
5394 }
5395 for val in &self.ar_u32 {
5396 __tmp.put_u32_le(*val);
5397 }
5398 for val in &self.ar_u16 {
5399 __tmp.put_u16_le(*val);
5400 }
5401 __tmp.put_u8(self.v1);
5402 for val in &self.ar_i8 {
5403 __tmp.put_i8(*val);
5404 }
5405 for val in &self.ar_u8 {
5406 __tmp.put_u8(*val);
5407 }
5408 if matches!(version, MavlinkVersion::V2) {
5409 let len = __tmp.len();
5410 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5411 } else {
5412 __tmp.len()
5413 }
5414 }
5415}
5416#[doc = "Array test #1."]
5417#[doc = ""]
5418#[doc = "ID: 17151"]
5419#[derive(Debug, Clone, PartialEq)]
5420#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5421#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5422#[cfg_attr(feature = "ts", derive(TS))]
5423#[cfg_attr(feature = "ts", ts(export))]
5424pub struct ARRAY_TEST_1_DATA {
5425 #[doc = "Value array"]
5426 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5427 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5428 pub ar_u32: [u32; 4],
5429}
5430impl ARRAY_TEST_1_DATA {
5431 pub const ENCODED_LEN: usize = 16usize;
5432 pub const DEFAULT: Self = Self {
5433 ar_u32: [0_u32; 4usize],
5434 };
5435 #[cfg(feature = "arbitrary")]
5436 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5437 use arbitrary::{Arbitrary, Unstructured};
5438 let mut buf = [0u8; 1024];
5439 rng.fill_bytes(&mut buf);
5440 let mut unstructured = Unstructured::new(&buf);
5441 Self::arbitrary(&mut unstructured).unwrap_or_default()
5442 }
5443}
5444impl Default for ARRAY_TEST_1_DATA {
5445 fn default() -> Self {
5446 Self::DEFAULT.clone()
5447 }
5448}
5449impl MessageData for ARRAY_TEST_1_DATA {
5450 type Message = MavMessage;
5451 const ID: u32 = 17151u32;
5452 const NAME: &'static str = "ARRAY_TEST_1";
5453 const EXTRA_CRC: u8 = 72u8;
5454 const ENCODED_LEN: usize = 16usize;
5455 fn deser(
5456 _version: MavlinkVersion,
5457 __input: &[u8],
5458 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5459 let avail_len = __input.len();
5460 let mut payload_buf = [0; Self::ENCODED_LEN];
5461 let mut buf = if avail_len < Self::ENCODED_LEN {
5462 payload_buf[0..avail_len].copy_from_slice(__input);
5463 Bytes::new(&payload_buf)
5464 } else {
5465 Bytes::new(__input)
5466 };
5467 let mut __struct = Self::default();
5468 for v in &mut __struct.ar_u32 {
5469 let val = buf.get_u32_le()?;
5470 *v = val;
5471 }
5472 Ok(__struct)
5473 }
5474 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5475 let mut __tmp = BytesMut::new(bytes);
5476 #[allow(clippy::absurd_extreme_comparisons)]
5477 #[allow(unused_comparisons)]
5478 if __tmp.remaining() < Self::ENCODED_LEN {
5479 panic!(
5480 "buffer is too small (need {} bytes, but got {})",
5481 Self::ENCODED_LEN,
5482 __tmp.remaining(),
5483 )
5484 }
5485 for val in &self.ar_u32 {
5486 __tmp.put_u32_le(*val);
5487 }
5488 if matches!(version, MavlinkVersion::V2) {
5489 let len = __tmp.len();
5490 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5491 } else {
5492 __tmp.len()
5493 }
5494 }
5495}
5496#[doc = "Array test #3."]
5497#[doc = ""]
5498#[doc = "ID: 17153"]
5499#[derive(Debug, Clone, PartialEq)]
5500#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5501#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5502#[cfg_attr(feature = "ts", derive(TS))]
5503#[cfg_attr(feature = "ts", ts(export))]
5504pub struct ARRAY_TEST_3_DATA {
5505 #[doc = "Value array"]
5506 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5507 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5508 pub ar_u32: [u32; 4],
5509 #[doc = "Stub field"]
5510 pub v: u8,
5511}
5512impl ARRAY_TEST_3_DATA {
5513 pub const ENCODED_LEN: usize = 17usize;
5514 pub const DEFAULT: Self = Self {
5515 ar_u32: [0_u32; 4usize],
5516 v: 0_u8,
5517 };
5518 #[cfg(feature = "arbitrary")]
5519 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5520 use arbitrary::{Arbitrary, Unstructured};
5521 let mut buf = [0u8; 1024];
5522 rng.fill_bytes(&mut buf);
5523 let mut unstructured = Unstructured::new(&buf);
5524 Self::arbitrary(&mut unstructured).unwrap_or_default()
5525 }
5526}
5527impl Default for ARRAY_TEST_3_DATA {
5528 fn default() -> Self {
5529 Self::DEFAULT.clone()
5530 }
5531}
5532impl MessageData for ARRAY_TEST_3_DATA {
5533 type Message = MavMessage;
5534 const ID: u32 = 17153u32;
5535 const NAME: &'static str = "ARRAY_TEST_3";
5536 const EXTRA_CRC: u8 = 19u8;
5537 const ENCODED_LEN: usize = 17usize;
5538 fn deser(
5539 _version: MavlinkVersion,
5540 __input: &[u8],
5541 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5542 let avail_len = __input.len();
5543 let mut payload_buf = [0; Self::ENCODED_LEN];
5544 let mut buf = if avail_len < Self::ENCODED_LEN {
5545 payload_buf[0..avail_len].copy_from_slice(__input);
5546 Bytes::new(&payload_buf)
5547 } else {
5548 Bytes::new(__input)
5549 };
5550 let mut __struct = Self::default();
5551 for v in &mut __struct.ar_u32 {
5552 let val = buf.get_u32_le()?;
5553 *v = val;
5554 }
5555 __struct.v = buf.get_u8()?;
5556 Ok(__struct)
5557 }
5558 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5559 let mut __tmp = BytesMut::new(bytes);
5560 #[allow(clippy::absurd_extreme_comparisons)]
5561 #[allow(unused_comparisons)]
5562 if __tmp.remaining() < Self::ENCODED_LEN {
5563 panic!(
5564 "buffer is too small (need {} bytes, but got {})",
5565 Self::ENCODED_LEN,
5566 __tmp.remaining(),
5567 )
5568 }
5569 for val in &self.ar_u32 {
5570 __tmp.put_u32_le(*val);
5571 }
5572 __tmp.put_u8(self.v);
5573 if matches!(version, MavlinkVersion::V2) {
5574 let len = __tmp.len();
5575 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5576 } else {
5577 __tmp.len()
5578 }
5579 }
5580}
5581#[doc = "Array test #4."]
5582#[doc = ""]
5583#[doc = "ID: 17154"]
5584#[derive(Debug, Clone, PartialEq)]
5585#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5586#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5587#[cfg_attr(feature = "ts", derive(TS))]
5588#[cfg_attr(feature = "ts", ts(export))]
5589pub struct ARRAY_TEST_4_DATA {
5590 #[doc = "Value array"]
5591 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5592 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5593 pub ar_u32: [u32; 4],
5594 #[doc = "Stub field"]
5595 pub v: u8,
5596}
5597impl ARRAY_TEST_4_DATA {
5598 pub const ENCODED_LEN: usize = 17usize;
5599 pub const DEFAULT: Self = Self {
5600 ar_u32: [0_u32; 4usize],
5601 v: 0_u8,
5602 };
5603 #[cfg(feature = "arbitrary")]
5604 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5605 use arbitrary::{Arbitrary, Unstructured};
5606 let mut buf = [0u8; 1024];
5607 rng.fill_bytes(&mut buf);
5608 let mut unstructured = Unstructured::new(&buf);
5609 Self::arbitrary(&mut unstructured).unwrap_or_default()
5610 }
5611}
5612impl Default for ARRAY_TEST_4_DATA {
5613 fn default() -> Self {
5614 Self::DEFAULT.clone()
5615 }
5616}
5617impl MessageData for ARRAY_TEST_4_DATA {
5618 type Message = MavMessage;
5619 const ID: u32 = 17154u32;
5620 const NAME: &'static str = "ARRAY_TEST_4";
5621 const EXTRA_CRC: u8 = 89u8;
5622 const ENCODED_LEN: usize = 17usize;
5623 fn deser(
5624 _version: MavlinkVersion,
5625 __input: &[u8],
5626 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5627 let avail_len = __input.len();
5628 let mut payload_buf = [0; Self::ENCODED_LEN];
5629 let mut buf = if avail_len < Self::ENCODED_LEN {
5630 payload_buf[0..avail_len].copy_from_slice(__input);
5631 Bytes::new(&payload_buf)
5632 } else {
5633 Bytes::new(__input)
5634 };
5635 let mut __struct = Self::default();
5636 for v in &mut __struct.ar_u32 {
5637 let val = buf.get_u32_le()?;
5638 *v = val;
5639 }
5640 __struct.v = buf.get_u8()?;
5641 Ok(__struct)
5642 }
5643 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5644 let mut __tmp = BytesMut::new(bytes);
5645 #[allow(clippy::absurd_extreme_comparisons)]
5646 #[allow(unused_comparisons)]
5647 if __tmp.remaining() < Self::ENCODED_LEN {
5648 panic!(
5649 "buffer is too small (need {} bytes, but got {})",
5650 Self::ENCODED_LEN,
5651 __tmp.remaining(),
5652 )
5653 }
5654 for val in &self.ar_u32 {
5655 __tmp.put_u32_le(*val);
5656 }
5657 __tmp.put_u8(self.v);
5658 if matches!(version, MavlinkVersion::V2) {
5659 let len = __tmp.len();
5660 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5661 } else {
5662 __tmp.len()
5663 }
5664 }
5665}
5666#[doc = "Array test #5."]
5667#[doc = ""]
5668#[doc = "ID: 17155"]
5669#[derive(Debug, Clone, PartialEq)]
5670#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5671#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5672#[cfg_attr(feature = "ts", derive(TS))]
5673#[cfg_attr(feature = "ts", ts(export))]
5674pub struct ARRAY_TEST_5_DATA {
5675 #[doc = "Value array"]
5676 #[cfg_attr(feature = "ts", ts(type = "string"))]
5677 pub c1: CharArray<5>,
5678 #[doc = "Value array"]
5679 #[cfg_attr(feature = "ts", ts(type = "string"))]
5680 pub c2: CharArray<5>,
5681}
5682impl ARRAY_TEST_5_DATA {
5683 pub const ENCODED_LEN: usize = 10usize;
5684 pub const DEFAULT: Self = Self {
5685 c1: CharArray::new([0_u8; 5usize]),
5686 c2: CharArray::new([0_u8; 5usize]),
5687 };
5688 #[cfg(feature = "arbitrary")]
5689 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5690 use arbitrary::{Arbitrary, Unstructured};
5691 let mut buf = [0u8; 1024];
5692 rng.fill_bytes(&mut buf);
5693 let mut unstructured = Unstructured::new(&buf);
5694 Self::arbitrary(&mut unstructured).unwrap_or_default()
5695 }
5696}
5697impl Default for ARRAY_TEST_5_DATA {
5698 fn default() -> Self {
5699 Self::DEFAULT.clone()
5700 }
5701}
5702impl MessageData for ARRAY_TEST_5_DATA {
5703 type Message = MavMessage;
5704 const ID: u32 = 17155u32;
5705 const NAME: &'static str = "ARRAY_TEST_5";
5706 const EXTRA_CRC: u8 = 27u8;
5707 const ENCODED_LEN: usize = 10usize;
5708 fn deser(
5709 _version: MavlinkVersion,
5710 __input: &[u8],
5711 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5712 let avail_len = __input.len();
5713 let mut payload_buf = [0; Self::ENCODED_LEN];
5714 let mut buf = if avail_len < Self::ENCODED_LEN {
5715 payload_buf[0..avail_len].copy_from_slice(__input);
5716 Bytes::new(&payload_buf)
5717 } else {
5718 Bytes::new(__input)
5719 };
5720 let mut __struct = Self::default();
5721 let mut tmp = [0_u8; 5usize];
5722 for v in &mut tmp {
5723 *v = buf.get_u8()?;
5724 }
5725 __struct.c1 = CharArray::new(tmp);
5726 let mut tmp = [0_u8; 5usize];
5727 for v in &mut tmp {
5728 *v = buf.get_u8()?;
5729 }
5730 __struct.c2 = CharArray::new(tmp);
5731 Ok(__struct)
5732 }
5733 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5734 let mut __tmp = BytesMut::new(bytes);
5735 #[allow(clippy::absurd_extreme_comparisons)]
5736 #[allow(unused_comparisons)]
5737 if __tmp.remaining() < Self::ENCODED_LEN {
5738 panic!(
5739 "buffer is too small (need {} bytes, but got {})",
5740 Self::ENCODED_LEN,
5741 __tmp.remaining(),
5742 )
5743 }
5744 for val in &self.c1 {
5745 __tmp.put_u8(*val);
5746 }
5747 for val in &self.c2 {
5748 __tmp.put_u8(*val);
5749 }
5750 if matches!(version, MavlinkVersion::V2) {
5751 let len = __tmp.len();
5752 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5753 } else {
5754 __tmp.len()
5755 }
5756 }
5757}
5758#[doc = "Array test #6."]
5759#[doc = ""]
5760#[doc = "ID: 17156"]
5761#[derive(Debug, Clone, PartialEq)]
5762#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5763#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5764#[cfg_attr(feature = "ts", derive(TS))]
5765#[cfg_attr(feature = "ts", ts(export))]
5766pub struct ARRAY_TEST_6_DATA {
5767 #[doc = "Value array"]
5768 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5769 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5770 pub ar_d: [f64; 2],
5771 #[doc = "Stub field"]
5772 pub v3: u32,
5773 #[doc = "Value array"]
5774 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5775 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5776 pub ar_u32: [u32; 2],
5777 #[doc = "Value array"]
5778 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5779 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5780 pub ar_i32: [i32; 2],
5781 #[doc = "Value array"]
5782 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5783 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5784 pub ar_f: [f32; 2],
5785 #[doc = "Stub field"]
5786 pub v2: u16,
5787 #[doc = "Value array"]
5788 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5789 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5790 pub ar_u16: [u16; 2],
5791 #[doc = "Value array"]
5792 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5793 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5794 pub ar_i16: [i16; 2],
5795 #[doc = "Stub field"]
5796 pub v1: u8,
5797 #[doc = "Value array"]
5798 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5799 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5800 pub ar_u8: [u8; 2],
5801 #[doc = "Value array"]
5802 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5803 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5804 pub ar_i8: [i8; 2],
5805 #[doc = "Value array"]
5806 #[cfg_attr(feature = "ts", ts(type = "string"))]
5807 pub ar_c: CharArray<32>,
5808}
5809impl ARRAY_TEST_6_DATA {
5810 pub const ENCODED_LEN: usize = 91usize;
5811 pub const DEFAULT: Self = Self {
5812 ar_d: [0.0_f64; 2usize],
5813 v3: 0_u32,
5814 ar_u32: [0_u32; 2usize],
5815 ar_i32: [0_i32; 2usize],
5816 ar_f: [0.0_f32; 2usize],
5817 v2: 0_u16,
5818 ar_u16: [0_u16; 2usize],
5819 ar_i16: [0_i16; 2usize],
5820 v1: 0_u8,
5821 ar_u8: [0_u8; 2usize],
5822 ar_i8: [0_i8; 2usize],
5823 ar_c: CharArray::new([0_u8; 32usize]),
5824 };
5825 #[cfg(feature = "arbitrary")]
5826 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5827 use arbitrary::{Arbitrary, Unstructured};
5828 let mut buf = [0u8; 1024];
5829 rng.fill_bytes(&mut buf);
5830 let mut unstructured = Unstructured::new(&buf);
5831 Self::arbitrary(&mut unstructured).unwrap_or_default()
5832 }
5833}
5834impl Default for ARRAY_TEST_6_DATA {
5835 fn default() -> Self {
5836 Self::DEFAULT.clone()
5837 }
5838}
5839impl MessageData for ARRAY_TEST_6_DATA {
5840 type Message = MavMessage;
5841 const ID: u32 = 17156u32;
5842 const NAME: &'static str = "ARRAY_TEST_6";
5843 const EXTRA_CRC: u8 = 14u8;
5844 const ENCODED_LEN: usize = 91usize;
5845 fn deser(
5846 _version: MavlinkVersion,
5847 __input: &[u8],
5848 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5849 let avail_len = __input.len();
5850 let mut payload_buf = [0; Self::ENCODED_LEN];
5851 let mut buf = if avail_len < Self::ENCODED_LEN {
5852 payload_buf[0..avail_len].copy_from_slice(__input);
5853 Bytes::new(&payload_buf)
5854 } else {
5855 Bytes::new(__input)
5856 };
5857 let mut __struct = Self::default();
5858 for v in &mut __struct.ar_d {
5859 let val = buf.get_f64_le()?;
5860 *v = val;
5861 }
5862 __struct.v3 = buf.get_u32_le()?;
5863 for v in &mut __struct.ar_u32 {
5864 let val = buf.get_u32_le()?;
5865 *v = val;
5866 }
5867 for v in &mut __struct.ar_i32 {
5868 let val = buf.get_i32_le()?;
5869 *v = val;
5870 }
5871 for v in &mut __struct.ar_f {
5872 let val = buf.get_f32_le()?;
5873 *v = val;
5874 }
5875 __struct.v2 = buf.get_u16_le()?;
5876 for v in &mut __struct.ar_u16 {
5877 let val = buf.get_u16_le()?;
5878 *v = val;
5879 }
5880 for v in &mut __struct.ar_i16 {
5881 let val = buf.get_i16_le()?;
5882 *v = val;
5883 }
5884 __struct.v1 = buf.get_u8()?;
5885 for v in &mut __struct.ar_u8 {
5886 let val = buf.get_u8()?;
5887 *v = val;
5888 }
5889 for v in &mut __struct.ar_i8 {
5890 let val = buf.get_i8()?;
5891 *v = val;
5892 }
5893 let mut tmp = [0_u8; 32usize];
5894 for v in &mut tmp {
5895 *v = buf.get_u8()?;
5896 }
5897 __struct.ar_c = CharArray::new(tmp);
5898 Ok(__struct)
5899 }
5900 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5901 let mut __tmp = BytesMut::new(bytes);
5902 #[allow(clippy::absurd_extreme_comparisons)]
5903 #[allow(unused_comparisons)]
5904 if __tmp.remaining() < Self::ENCODED_LEN {
5905 panic!(
5906 "buffer is too small (need {} bytes, but got {})",
5907 Self::ENCODED_LEN,
5908 __tmp.remaining(),
5909 )
5910 }
5911 for val in &self.ar_d {
5912 __tmp.put_f64_le(*val);
5913 }
5914 __tmp.put_u32_le(self.v3);
5915 for val in &self.ar_u32 {
5916 __tmp.put_u32_le(*val);
5917 }
5918 for val in &self.ar_i32 {
5919 __tmp.put_i32_le(*val);
5920 }
5921 for val in &self.ar_f {
5922 __tmp.put_f32_le(*val);
5923 }
5924 __tmp.put_u16_le(self.v2);
5925 for val in &self.ar_u16 {
5926 __tmp.put_u16_le(*val);
5927 }
5928 for val in &self.ar_i16 {
5929 __tmp.put_i16_le(*val);
5930 }
5931 __tmp.put_u8(self.v1);
5932 for val in &self.ar_u8 {
5933 __tmp.put_u8(*val);
5934 }
5935 for val in &self.ar_i8 {
5936 __tmp.put_i8(*val);
5937 }
5938 for val in &self.ar_c {
5939 __tmp.put_u8(*val);
5940 }
5941 if matches!(version, MavlinkVersion::V2) {
5942 let len = __tmp.len();
5943 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5944 } else {
5945 __tmp.len()
5946 }
5947 }
5948}
5949#[doc = "Array test #7."]
5950#[doc = ""]
5951#[doc = "ID: 17157"]
5952#[derive(Debug, Clone, PartialEq)]
5953#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5954#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5955#[cfg_attr(feature = "ts", derive(TS))]
5956#[cfg_attr(feature = "ts", ts(export))]
5957pub struct ARRAY_TEST_7_DATA {
5958 #[doc = "Value array"]
5959 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5960 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5961 pub ar_d: [f64; 2],
5962 #[doc = "Value array"]
5963 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5964 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5965 pub ar_f: [f32; 2],
5966 #[doc = "Value array"]
5967 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5968 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5969 pub ar_u32: [u32; 2],
5970 #[doc = "Value array"]
5971 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5972 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5973 pub ar_i32: [i32; 2],
5974 #[doc = "Value array"]
5975 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5976 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5977 pub ar_u16: [u16; 2],
5978 #[doc = "Value array"]
5979 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5980 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5981 pub ar_i16: [i16; 2],
5982 #[doc = "Value array"]
5983 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5984 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5985 pub ar_u8: [u8; 2],
5986 #[doc = "Value array"]
5987 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5988 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
5989 pub ar_i8: [i8; 2],
5990 #[doc = "Value array"]
5991 #[cfg_attr(feature = "ts", ts(type = "string"))]
5992 pub ar_c: CharArray<32>,
5993}
5994impl ARRAY_TEST_7_DATA {
5995 pub const ENCODED_LEN: usize = 84usize;
5996 pub const DEFAULT: Self = Self {
5997 ar_d: [0.0_f64; 2usize],
5998 ar_f: [0.0_f32; 2usize],
5999 ar_u32: [0_u32; 2usize],
6000 ar_i32: [0_i32; 2usize],
6001 ar_u16: [0_u16; 2usize],
6002 ar_i16: [0_i16; 2usize],
6003 ar_u8: [0_u8; 2usize],
6004 ar_i8: [0_i8; 2usize],
6005 ar_c: CharArray::new([0_u8; 32usize]),
6006 };
6007 #[cfg(feature = "arbitrary")]
6008 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6009 use arbitrary::{Arbitrary, Unstructured};
6010 let mut buf = [0u8; 1024];
6011 rng.fill_bytes(&mut buf);
6012 let mut unstructured = Unstructured::new(&buf);
6013 Self::arbitrary(&mut unstructured).unwrap_or_default()
6014 }
6015}
6016impl Default for ARRAY_TEST_7_DATA {
6017 fn default() -> Self {
6018 Self::DEFAULT.clone()
6019 }
6020}
6021impl MessageData for ARRAY_TEST_7_DATA {
6022 type Message = MavMessage;
6023 const ID: u32 = 17157u32;
6024 const NAME: &'static str = "ARRAY_TEST_7";
6025 const EXTRA_CRC: u8 = 187u8;
6026 const ENCODED_LEN: usize = 84usize;
6027 fn deser(
6028 _version: MavlinkVersion,
6029 __input: &[u8],
6030 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6031 let avail_len = __input.len();
6032 let mut payload_buf = [0; Self::ENCODED_LEN];
6033 let mut buf = if avail_len < Self::ENCODED_LEN {
6034 payload_buf[0..avail_len].copy_from_slice(__input);
6035 Bytes::new(&payload_buf)
6036 } else {
6037 Bytes::new(__input)
6038 };
6039 let mut __struct = Self::default();
6040 for v in &mut __struct.ar_d {
6041 let val = buf.get_f64_le()?;
6042 *v = val;
6043 }
6044 for v in &mut __struct.ar_f {
6045 let val = buf.get_f32_le()?;
6046 *v = val;
6047 }
6048 for v in &mut __struct.ar_u32 {
6049 let val = buf.get_u32_le()?;
6050 *v = val;
6051 }
6052 for v in &mut __struct.ar_i32 {
6053 let val = buf.get_i32_le()?;
6054 *v = val;
6055 }
6056 for v in &mut __struct.ar_u16 {
6057 let val = buf.get_u16_le()?;
6058 *v = val;
6059 }
6060 for v in &mut __struct.ar_i16 {
6061 let val = buf.get_i16_le()?;
6062 *v = val;
6063 }
6064 for v in &mut __struct.ar_u8 {
6065 let val = buf.get_u8()?;
6066 *v = val;
6067 }
6068 for v in &mut __struct.ar_i8 {
6069 let val = buf.get_i8()?;
6070 *v = val;
6071 }
6072 let mut tmp = [0_u8; 32usize];
6073 for v in &mut tmp {
6074 *v = buf.get_u8()?;
6075 }
6076 __struct.ar_c = CharArray::new(tmp);
6077 Ok(__struct)
6078 }
6079 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6080 let mut __tmp = BytesMut::new(bytes);
6081 #[allow(clippy::absurd_extreme_comparisons)]
6082 #[allow(unused_comparisons)]
6083 if __tmp.remaining() < Self::ENCODED_LEN {
6084 panic!(
6085 "buffer is too small (need {} bytes, but got {})",
6086 Self::ENCODED_LEN,
6087 __tmp.remaining(),
6088 )
6089 }
6090 for val in &self.ar_d {
6091 __tmp.put_f64_le(*val);
6092 }
6093 for val in &self.ar_f {
6094 __tmp.put_f32_le(*val);
6095 }
6096 for val in &self.ar_u32 {
6097 __tmp.put_u32_le(*val);
6098 }
6099 for val in &self.ar_i32 {
6100 __tmp.put_i32_le(*val);
6101 }
6102 for val in &self.ar_u16 {
6103 __tmp.put_u16_le(*val);
6104 }
6105 for val in &self.ar_i16 {
6106 __tmp.put_i16_le(*val);
6107 }
6108 for val in &self.ar_u8 {
6109 __tmp.put_u8(*val);
6110 }
6111 for val in &self.ar_i8 {
6112 __tmp.put_i8(*val);
6113 }
6114 for val in &self.ar_c {
6115 __tmp.put_u8(*val);
6116 }
6117 if matches!(version, MavlinkVersion::V2) {
6118 let len = __tmp.len();
6119 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6120 } else {
6121 __tmp.len()
6122 }
6123 }
6124}
6125#[doc = "Array test #8."]
6126#[doc = ""]
6127#[doc = "ID: 17158"]
6128#[derive(Debug, Clone, PartialEq)]
6129#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6131#[cfg_attr(feature = "ts", derive(TS))]
6132#[cfg_attr(feature = "ts", ts(export))]
6133pub struct ARRAY_TEST_8_DATA {
6134 #[doc = "Value array"]
6135 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6136 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6137 pub ar_d: [f64; 2],
6138 #[doc = "Stub field"]
6139 pub v3: u32,
6140 #[doc = "Value array"]
6141 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6142 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6143 pub ar_u16: [u16; 2],
6144}
6145impl ARRAY_TEST_8_DATA {
6146 pub const ENCODED_LEN: usize = 24usize;
6147 pub const DEFAULT: Self = Self {
6148 ar_d: [0.0_f64; 2usize],
6149 v3: 0_u32,
6150 ar_u16: [0_u16; 2usize],
6151 };
6152 #[cfg(feature = "arbitrary")]
6153 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6154 use arbitrary::{Arbitrary, Unstructured};
6155 let mut buf = [0u8; 1024];
6156 rng.fill_bytes(&mut buf);
6157 let mut unstructured = Unstructured::new(&buf);
6158 Self::arbitrary(&mut unstructured).unwrap_or_default()
6159 }
6160}
6161impl Default for ARRAY_TEST_8_DATA {
6162 fn default() -> Self {
6163 Self::DEFAULT.clone()
6164 }
6165}
6166impl MessageData for ARRAY_TEST_8_DATA {
6167 type Message = MavMessage;
6168 const ID: u32 = 17158u32;
6169 const NAME: &'static str = "ARRAY_TEST_8";
6170 const EXTRA_CRC: u8 = 106u8;
6171 const ENCODED_LEN: usize = 24usize;
6172 fn deser(
6173 _version: MavlinkVersion,
6174 __input: &[u8],
6175 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6176 let avail_len = __input.len();
6177 let mut payload_buf = [0; Self::ENCODED_LEN];
6178 let mut buf = if avail_len < Self::ENCODED_LEN {
6179 payload_buf[0..avail_len].copy_from_slice(__input);
6180 Bytes::new(&payload_buf)
6181 } else {
6182 Bytes::new(__input)
6183 };
6184 let mut __struct = Self::default();
6185 for v in &mut __struct.ar_d {
6186 let val = buf.get_f64_le()?;
6187 *v = val;
6188 }
6189 __struct.v3 = buf.get_u32_le()?;
6190 for v in &mut __struct.ar_u16 {
6191 let val = buf.get_u16_le()?;
6192 *v = val;
6193 }
6194 Ok(__struct)
6195 }
6196 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6197 let mut __tmp = BytesMut::new(bytes);
6198 #[allow(clippy::absurd_extreme_comparisons)]
6199 #[allow(unused_comparisons)]
6200 if __tmp.remaining() < Self::ENCODED_LEN {
6201 panic!(
6202 "buffer is too small (need {} bytes, but got {})",
6203 Self::ENCODED_LEN,
6204 __tmp.remaining(),
6205 )
6206 }
6207 for val in &self.ar_d {
6208 __tmp.put_f64_le(*val);
6209 }
6210 __tmp.put_u32_le(self.v3);
6211 for val in &self.ar_u16 {
6212 __tmp.put_u16_le(*val);
6213 }
6214 if matches!(version, MavlinkVersion::V2) {
6215 let len = __tmp.len();
6216 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6217 } else {
6218 __tmp.len()
6219 }
6220 }
6221}
6222#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
6223#[doc = ""]
6224#[doc = "ID: 30"]
6225#[derive(Debug, Clone, PartialEq)]
6226#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6227#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6228#[cfg_attr(feature = "ts", derive(TS))]
6229#[cfg_attr(feature = "ts", ts(export))]
6230pub struct ATTITUDE_DATA {
6231 #[doc = "Timestamp (time since system boot)."]
6232 pub time_boot_ms: u32,
6233 #[doc = "Roll angle (-pi..+pi)"]
6234 pub roll: f32,
6235 #[doc = "Pitch angle (-pi..+pi)"]
6236 pub pitch: f32,
6237 #[doc = "Yaw angle (-pi..+pi)"]
6238 pub yaw: f32,
6239 #[doc = "Roll angular speed"]
6240 pub rollspeed: f32,
6241 #[doc = "Pitch angular speed"]
6242 pub pitchspeed: f32,
6243 #[doc = "Yaw angular speed"]
6244 pub yawspeed: f32,
6245}
6246impl ATTITUDE_DATA {
6247 pub const ENCODED_LEN: usize = 28usize;
6248 pub const DEFAULT: Self = Self {
6249 time_boot_ms: 0_u32,
6250 roll: 0.0_f32,
6251 pitch: 0.0_f32,
6252 yaw: 0.0_f32,
6253 rollspeed: 0.0_f32,
6254 pitchspeed: 0.0_f32,
6255 yawspeed: 0.0_f32,
6256 };
6257 #[cfg(feature = "arbitrary")]
6258 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6259 use arbitrary::{Arbitrary, Unstructured};
6260 let mut buf = [0u8; 1024];
6261 rng.fill_bytes(&mut buf);
6262 let mut unstructured = Unstructured::new(&buf);
6263 Self::arbitrary(&mut unstructured).unwrap_or_default()
6264 }
6265}
6266impl Default for ATTITUDE_DATA {
6267 fn default() -> Self {
6268 Self::DEFAULT.clone()
6269 }
6270}
6271impl MessageData for ATTITUDE_DATA {
6272 type Message = MavMessage;
6273 const ID: u32 = 30u32;
6274 const NAME: &'static str = "ATTITUDE";
6275 const EXTRA_CRC: u8 = 39u8;
6276 const ENCODED_LEN: usize = 28usize;
6277 fn deser(
6278 _version: MavlinkVersion,
6279 __input: &[u8],
6280 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6281 let avail_len = __input.len();
6282 let mut payload_buf = [0; Self::ENCODED_LEN];
6283 let mut buf = if avail_len < Self::ENCODED_LEN {
6284 payload_buf[0..avail_len].copy_from_slice(__input);
6285 Bytes::new(&payload_buf)
6286 } else {
6287 Bytes::new(__input)
6288 };
6289 let mut __struct = Self::default();
6290 __struct.time_boot_ms = buf.get_u32_le()?;
6291 __struct.roll = buf.get_f32_le()?;
6292 __struct.pitch = buf.get_f32_le()?;
6293 __struct.yaw = buf.get_f32_le()?;
6294 __struct.rollspeed = buf.get_f32_le()?;
6295 __struct.pitchspeed = buf.get_f32_le()?;
6296 __struct.yawspeed = buf.get_f32_le()?;
6297 Ok(__struct)
6298 }
6299 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6300 let mut __tmp = BytesMut::new(bytes);
6301 #[allow(clippy::absurd_extreme_comparisons)]
6302 #[allow(unused_comparisons)]
6303 if __tmp.remaining() < Self::ENCODED_LEN {
6304 panic!(
6305 "buffer is too small (need {} bytes, but got {})",
6306 Self::ENCODED_LEN,
6307 __tmp.remaining(),
6308 )
6309 }
6310 __tmp.put_u32_le(self.time_boot_ms);
6311 __tmp.put_f32_le(self.roll);
6312 __tmp.put_f32_le(self.pitch);
6313 __tmp.put_f32_le(self.yaw);
6314 __tmp.put_f32_le(self.rollspeed);
6315 __tmp.put_f32_le(self.pitchspeed);
6316 __tmp.put_f32_le(self.yawspeed);
6317 if matches!(version, MavlinkVersion::V2) {
6318 let len = __tmp.len();
6319 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6320 } else {
6321 __tmp.len()
6322 }
6323 }
6324}
6325#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
6326#[doc = ""]
6327#[doc = "ID: 31"]
6328#[derive(Debug, Clone, PartialEq)]
6329#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6330#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6331#[cfg_attr(feature = "ts", derive(TS))]
6332#[cfg_attr(feature = "ts", ts(export))]
6333pub struct ATTITUDE_QUATERNION_DATA {
6334 #[doc = "Timestamp (time since system boot)."]
6335 pub time_boot_ms: u32,
6336 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
6337 pub q1: f32,
6338 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
6339 pub q2: f32,
6340 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
6341 pub q3: f32,
6342 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
6343 pub q4: f32,
6344 #[doc = "Roll angular speed"]
6345 pub rollspeed: f32,
6346 #[doc = "Pitch angular speed"]
6347 pub pitchspeed: f32,
6348 #[doc = "Yaw angular speed"]
6349 pub yawspeed: f32,
6350 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
6351 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6352 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6353 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6354 pub repr_offset_q: [f32; 4],
6355}
6356impl ATTITUDE_QUATERNION_DATA {
6357 pub const ENCODED_LEN: usize = 48usize;
6358 pub const DEFAULT: Self = Self {
6359 time_boot_ms: 0_u32,
6360 q1: 0.0_f32,
6361 q2: 0.0_f32,
6362 q3: 0.0_f32,
6363 q4: 0.0_f32,
6364 rollspeed: 0.0_f32,
6365 pitchspeed: 0.0_f32,
6366 yawspeed: 0.0_f32,
6367 repr_offset_q: [0.0_f32; 4usize],
6368 };
6369 #[cfg(feature = "arbitrary")]
6370 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6371 use arbitrary::{Arbitrary, Unstructured};
6372 let mut buf = [0u8; 1024];
6373 rng.fill_bytes(&mut buf);
6374 let mut unstructured = Unstructured::new(&buf);
6375 Self::arbitrary(&mut unstructured).unwrap_or_default()
6376 }
6377}
6378impl Default for ATTITUDE_QUATERNION_DATA {
6379 fn default() -> Self {
6380 Self::DEFAULT.clone()
6381 }
6382}
6383impl MessageData for ATTITUDE_QUATERNION_DATA {
6384 type Message = MavMessage;
6385 const ID: u32 = 31u32;
6386 const NAME: &'static str = "ATTITUDE_QUATERNION";
6387 const EXTRA_CRC: u8 = 246u8;
6388 const ENCODED_LEN: usize = 48usize;
6389 fn deser(
6390 _version: MavlinkVersion,
6391 __input: &[u8],
6392 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6393 let avail_len = __input.len();
6394 let mut payload_buf = [0; Self::ENCODED_LEN];
6395 let mut buf = if avail_len < Self::ENCODED_LEN {
6396 payload_buf[0..avail_len].copy_from_slice(__input);
6397 Bytes::new(&payload_buf)
6398 } else {
6399 Bytes::new(__input)
6400 };
6401 let mut __struct = Self::default();
6402 __struct.time_boot_ms = buf.get_u32_le()?;
6403 __struct.q1 = buf.get_f32_le()?;
6404 __struct.q2 = buf.get_f32_le()?;
6405 __struct.q3 = buf.get_f32_le()?;
6406 __struct.q4 = buf.get_f32_le()?;
6407 __struct.rollspeed = buf.get_f32_le()?;
6408 __struct.pitchspeed = buf.get_f32_le()?;
6409 __struct.yawspeed = buf.get_f32_le()?;
6410 for v in &mut __struct.repr_offset_q {
6411 let val = buf.get_f32_le()?;
6412 *v = val;
6413 }
6414 Ok(__struct)
6415 }
6416 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6417 let mut __tmp = BytesMut::new(bytes);
6418 #[allow(clippy::absurd_extreme_comparisons)]
6419 #[allow(unused_comparisons)]
6420 if __tmp.remaining() < Self::ENCODED_LEN {
6421 panic!(
6422 "buffer is too small (need {} bytes, but got {})",
6423 Self::ENCODED_LEN,
6424 __tmp.remaining(),
6425 )
6426 }
6427 __tmp.put_u32_le(self.time_boot_ms);
6428 __tmp.put_f32_le(self.q1);
6429 __tmp.put_f32_le(self.q2);
6430 __tmp.put_f32_le(self.q3);
6431 __tmp.put_f32_le(self.q4);
6432 __tmp.put_f32_le(self.rollspeed);
6433 __tmp.put_f32_le(self.pitchspeed);
6434 __tmp.put_f32_le(self.yawspeed);
6435 if matches!(version, MavlinkVersion::V2) {
6436 for val in &self.repr_offset_q {
6437 __tmp.put_f32_le(*val);
6438 }
6439 let len = __tmp.len();
6440 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6441 } else {
6442 __tmp.len()
6443 }
6444 }
6445}
6446#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
6447#[doc = ""]
6448#[doc = "ID: 61"]
6449#[derive(Debug, Clone, PartialEq)]
6450#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6451#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6452#[cfg_attr(feature = "ts", derive(TS))]
6453#[cfg_attr(feature = "ts", ts(export))]
6454pub struct ATTITUDE_QUATERNION_COV_DATA {
6455 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
6456 pub time_usec: u64,
6457 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
6458 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6459 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6460 pub q: [f32; 4],
6461 #[doc = "Roll angular speed"]
6462 pub rollspeed: f32,
6463 #[doc = "Pitch angular speed"]
6464 pub pitchspeed: f32,
6465 #[doc = "Yaw angular speed"]
6466 pub yawspeed: f32,
6467 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
6468 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6469 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6470 pub covariance: [f32; 9],
6471}
6472impl ATTITUDE_QUATERNION_COV_DATA {
6473 pub const ENCODED_LEN: usize = 72usize;
6474 pub const DEFAULT: Self = Self {
6475 time_usec: 0_u64,
6476 q: [0.0_f32; 4usize],
6477 rollspeed: 0.0_f32,
6478 pitchspeed: 0.0_f32,
6479 yawspeed: 0.0_f32,
6480 covariance: [0.0_f32; 9usize],
6481 };
6482 #[cfg(feature = "arbitrary")]
6483 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6484 use arbitrary::{Arbitrary, Unstructured};
6485 let mut buf = [0u8; 1024];
6486 rng.fill_bytes(&mut buf);
6487 let mut unstructured = Unstructured::new(&buf);
6488 Self::arbitrary(&mut unstructured).unwrap_or_default()
6489 }
6490}
6491impl Default for ATTITUDE_QUATERNION_COV_DATA {
6492 fn default() -> Self {
6493 Self::DEFAULT.clone()
6494 }
6495}
6496impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
6497 type Message = MavMessage;
6498 const ID: u32 = 61u32;
6499 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
6500 const EXTRA_CRC: u8 = 167u8;
6501 const ENCODED_LEN: usize = 72usize;
6502 fn deser(
6503 _version: MavlinkVersion,
6504 __input: &[u8],
6505 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6506 let avail_len = __input.len();
6507 let mut payload_buf = [0; Self::ENCODED_LEN];
6508 let mut buf = if avail_len < Self::ENCODED_LEN {
6509 payload_buf[0..avail_len].copy_from_slice(__input);
6510 Bytes::new(&payload_buf)
6511 } else {
6512 Bytes::new(__input)
6513 };
6514 let mut __struct = Self::default();
6515 __struct.time_usec = buf.get_u64_le()?;
6516 for v in &mut __struct.q {
6517 let val = buf.get_f32_le()?;
6518 *v = val;
6519 }
6520 __struct.rollspeed = buf.get_f32_le()?;
6521 __struct.pitchspeed = buf.get_f32_le()?;
6522 __struct.yawspeed = buf.get_f32_le()?;
6523 for v in &mut __struct.covariance {
6524 let val = buf.get_f32_le()?;
6525 *v = val;
6526 }
6527 Ok(__struct)
6528 }
6529 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6530 let mut __tmp = BytesMut::new(bytes);
6531 #[allow(clippy::absurd_extreme_comparisons)]
6532 #[allow(unused_comparisons)]
6533 if __tmp.remaining() < Self::ENCODED_LEN {
6534 panic!(
6535 "buffer is too small (need {} bytes, but got {})",
6536 Self::ENCODED_LEN,
6537 __tmp.remaining(),
6538 )
6539 }
6540 __tmp.put_u64_le(self.time_usec);
6541 for val in &self.q {
6542 __tmp.put_f32_le(*val);
6543 }
6544 __tmp.put_f32_le(self.rollspeed);
6545 __tmp.put_f32_le(self.pitchspeed);
6546 __tmp.put_f32_le(self.yawspeed);
6547 for val in &self.covariance {
6548 __tmp.put_f32_le(*val);
6549 }
6550 if matches!(version, MavlinkVersion::V2) {
6551 let len = __tmp.len();
6552 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6553 } else {
6554 __tmp.len()
6555 }
6556 }
6557}
6558#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
6559#[doc = ""]
6560#[doc = "ID: 83"]
6561#[derive(Debug, Clone, PartialEq)]
6562#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6563#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6564#[cfg_attr(feature = "ts", derive(TS))]
6565#[cfg_attr(feature = "ts", ts(export))]
6566pub struct ATTITUDE_TARGET_DATA {
6567 #[doc = "Timestamp (time since system boot)."]
6568 pub time_boot_ms: u32,
6569 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
6570 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6571 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6572 pub q: [f32; 4],
6573 #[doc = "Body roll rate"]
6574 pub body_roll_rate: f32,
6575 #[doc = "Body pitch rate"]
6576 pub body_pitch_rate: f32,
6577 #[doc = "Body yaw rate"]
6578 pub body_yaw_rate: f32,
6579 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
6580 pub thrust: f32,
6581 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
6582 pub type_mask: AttitudeTargetTypemask,
6583}
6584impl ATTITUDE_TARGET_DATA {
6585 pub const ENCODED_LEN: usize = 37usize;
6586 pub const DEFAULT: Self = Self {
6587 time_boot_ms: 0_u32,
6588 q: [0.0_f32; 4usize],
6589 body_roll_rate: 0.0_f32,
6590 body_pitch_rate: 0.0_f32,
6591 body_yaw_rate: 0.0_f32,
6592 thrust: 0.0_f32,
6593 type_mask: AttitudeTargetTypemask::DEFAULT,
6594 };
6595 #[cfg(feature = "arbitrary")]
6596 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6597 use arbitrary::{Arbitrary, Unstructured};
6598 let mut buf = [0u8; 1024];
6599 rng.fill_bytes(&mut buf);
6600 let mut unstructured = Unstructured::new(&buf);
6601 Self::arbitrary(&mut unstructured).unwrap_or_default()
6602 }
6603}
6604impl Default for ATTITUDE_TARGET_DATA {
6605 fn default() -> Self {
6606 Self::DEFAULT.clone()
6607 }
6608}
6609impl MessageData for ATTITUDE_TARGET_DATA {
6610 type Message = MavMessage;
6611 const ID: u32 = 83u32;
6612 const NAME: &'static str = "ATTITUDE_TARGET";
6613 const EXTRA_CRC: u8 = 22u8;
6614 const ENCODED_LEN: usize = 37usize;
6615 fn deser(
6616 _version: MavlinkVersion,
6617 __input: &[u8],
6618 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6619 let avail_len = __input.len();
6620 let mut payload_buf = [0; Self::ENCODED_LEN];
6621 let mut buf = if avail_len < Self::ENCODED_LEN {
6622 payload_buf[0..avail_len].copy_from_slice(__input);
6623 Bytes::new(&payload_buf)
6624 } else {
6625 Bytes::new(__input)
6626 };
6627 let mut __struct = Self::default();
6628 __struct.time_boot_ms = buf.get_u32_le()?;
6629 for v in &mut __struct.q {
6630 let val = buf.get_f32_le()?;
6631 *v = val;
6632 }
6633 __struct.body_roll_rate = buf.get_f32_le()?;
6634 __struct.body_pitch_rate = buf.get_f32_le()?;
6635 __struct.body_yaw_rate = buf.get_f32_le()?;
6636 __struct.thrust = buf.get_f32_le()?;
6637 let tmp = buf.get_u8()?;
6638 __struct.type_mask =
6639 AttitudeTargetTypemask::from_bits(tmp as <AttitudeTargetTypemask as Flags>::Bits)
6640 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6641 flag_type: "AttitudeTargetTypemask",
6642 value: tmp as u64,
6643 })?;
6644 Ok(__struct)
6645 }
6646 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6647 let mut __tmp = BytesMut::new(bytes);
6648 #[allow(clippy::absurd_extreme_comparisons)]
6649 #[allow(unused_comparisons)]
6650 if __tmp.remaining() < Self::ENCODED_LEN {
6651 panic!(
6652 "buffer is too small (need {} bytes, but got {})",
6653 Self::ENCODED_LEN,
6654 __tmp.remaining(),
6655 )
6656 }
6657 __tmp.put_u32_le(self.time_boot_ms);
6658 for val in &self.q {
6659 __tmp.put_f32_le(*val);
6660 }
6661 __tmp.put_f32_le(self.body_roll_rate);
6662 __tmp.put_f32_le(self.body_pitch_rate);
6663 __tmp.put_f32_le(self.body_yaw_rate);
6664 __tmp.put_f32_le(self.thrust);
6665 __tmp.put_u8(self.type_mask.bits() as u8);
6666 if matches!(version, MavlinkVersion::V2) {
6667 let len = __tmp.len();
6668 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6669 } else {
6670 __tmp.len()
6671 }
6672 }
6673}
6674#[doc = "Motion capture attitude and position."]
6675#[doc = ""]
6676#[doc = "ID: 138"]
6677#[derive(Debug, Clone, PartialEq)]
6678#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6679#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6680#[cfg_attr(feature = "ts", derive(TS))]
6681#[cfg_attr(feature = "ts", ts(export))]
6682pub struct ATT_POS_MOCAP_DATA {
6683 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
6684 pub time_usec: u64,
6685 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
6686 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6687 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6688 pub q: [f32; 4],
6689 #[doc = "X position (NED)"]
6690 pub x: f32,
6691 #[doc = "Y position (NED)"]
6692 pub y: f32,
6693 #[doc = "Z position (NED)"]
6694 pub z: f32,
6695 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
6696 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6697 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6698 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6699 pub covariance: [f32; 21],
6700}
6701impl ATT_POS_MOCAP_DATA {
6702 pub const ENCODED_LEN: usize = 120usize;
6703 pub const DEFAULT: Self = Self {
6704 time_usec: 0_u64,
6705 q: [0.0_f32; 4usize],
6706 x: 0.0_f32,
6707 y: 0.0_f32,
6708 z: 0.0_f32,
6709 covariance: [0.0_f32; 21usize],
6710 };
6711 #[cfg(feature = "arbitrary")]
6712 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6713 use arbitrary::{Arbitrary, Unstructured};
6714 let mut buf = [0u8; 1024];
6715 rng.fill_bytes(&mut buf);
6716 let mut unstructured = Unstructured::new(&buf);
6717 Self::arbitrary(&mut unstructured).unwrap_or_default()
6718 }
6719}
6720impl Default for ATT_POS_MOCAP_DATA {
6721 fn default() -> Self {
6722 Self::DEFAULT.clone()
6723 }
6724}
6725impl MessageData for ATT_POS_MOCAP_DATA {
6726 type Message = MavMessage;
6727 const ID: u32 = 138u32;
6728 const NAME: &'static str = "ATT_POS_MOCAP";
6729 const EXTRA_CRC: u8 = 109u8;
6730 const ENCODED_LEN: usize = 120usize;
6731 fn deser(
6732 _version: MavlinkVersion,
6733 __input: &[u8],
6734 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6735 let avail_len = __input.len();
6736 let mut payload_buf = [0; Self::ENCODED_LEN];
6737 let mut buf = if avail_len < Self::ENCODED_LEN {
6738 payload_buf[0..avail_len].copy_from_slice(__input);
6739 Bytes::new(&payload_buf)
6740 } else {
6741 Bytes::new(__input)
6742 };
6743 let mut __struct = Self::default();
6744 __struct.time_usec = buf.get_u64_le()?;
6745 for v in &mut __struct.q {
6746 let val = buf.get_f32_le()?;
6747 *v = val;
6748 }
6749 __struct.x = buf.get_f32_le()?;
6750 __struct.y = buf.get_f32_le()?;
6751 __struct.z = buf.get_f32_le()?;
6752 for v in &mut __struct.covariance {
6753 let val = buf.get_f32_le()?;
6754 *v = val;
6755 }
6756 Ok(__struct)
6757 }
6758 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6759 let mut __tmp = BytesMut::new(bytes);
6760 #[allow(clippy::absurd_extreme_comparisons)]
6761 #[allow(unused_comparisons)]
6762 if __tmp.remaining() < Self::ENCODED_LEN {
6763 panic!(
6764 "buffer is too small (need {} bytes, but got {})",
6765 Self::ENCODED_LEN,
6766 __tmp.remaining(),
6767 )
6768 }
6769 __tmp.put_u64_le(self.time_usec);
6770 for val in &self.q {
6771 __tmp.put_f32_le(*val);
6772 }
6773 __tmp.put_f32_le(self.x);
6774 __tmp.put_f32_le(self.y);
6775 __tmp.put_f32_le(self.z);
6776 if matches!(version, MavlinkVersion::V2) {
6777 for val in &self.covariance {
6778 __tmp.put_f32_le(*val);
6779 }
6780 let len = __tmp.len();
6781 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6782 } else {
6783 __tmp.len()
6784 }
6785 }
6786}
6787#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
6788#[doc = ""]
6789#[doc = "ID: 7"]
6790#[derive(Debug, Clone, PartialEq)]
6791#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6792#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6793#[cfg_attr(feature = "ts", derive(TS))]
6794#[cfg_attr(feature = "ts", ts(export))]
6795pub struct AUTH_KEY_DATA {
6796 #[doc = "key"]
6797 #[cfg_attr(feature = "ts", ts(type = "string"))]
6798 pub key: CharArray<32>,
6799}
6800impl AUTH_KEY_DATA {
6801 pub const ENCODED_LEN: usize = 32usize;
6802 pub const DEFAULT: Self = Self {
6803 key: CharArray::new([0_u8; 32usize]),
6804 };
6805 #[cfg(feature = "arbitrary")]
6806 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6807 use arbitrary::{Arbitrary, Unstructured};
6808 let mut buf = [0u8; 1024];
6809 rng.fill_bytes(&mut buf);
6810 let mut unstructured = Unstructured::new(&buf);
6811 Self::arbitrary(&mut unstructured).unwrap_or_default()
6812 }
6813}
6814impl Default for AUTH_KEY_DATA {
6815 fn default() -> Self {
6816 Self::DEFAULT.clone()
6817 }
6818}
6819impl MessageData for AUTH_KEY_DATA {
6820 type Message = MavMessage;
6821 const ID: u32 = 7u32;
6822 const NAME: &'static str = "AUTH_KEY";
6823 const EXTRA_CRC: u8 = 119u8;
6824 const ENCODED_LEN: usize = 32usize;
6825 fn deser(
6826 _version: MavlinkVersion,
6827 __input: &[u8],
6828 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6829 let avail_len = __input.len();
6830 let mut payload_buf = [0; Self::ENCODED_LEN];
6831 let mut buf = if avail_len < Self::ENCODED_LEN {
6832 payload_buf[0..avail_len].copy_from_slice(__input);
6833 Bytes::new(&payload_buf)
6834 } else {
6835 Bytes::new(__input)
6836 };
6837 let mut __struct = Self::default();
6838 let mut tmp = [0_u8; 32usize];
6839 for v in &mut tmp {
6840 *v = buf.get_u8()?;
6841 }
6842 __struct.key = CharArray::new(tmp);
6843 Ok(__struct)
6844 }
6845 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6846 let mut __tmp = BytesMut::new(bytes);
6847 #[allow(clippy::absurd_extreme_comparisons)]
6848 #[allow(unused_comparisons)]
6849 if __tmp.remaining() < Self::ENCODED_LEN {
6850 panic!(
6851 "buffer is too small (need {} bytes, but got {})",
6852 Self::ENCODED_LEN,
6853 __tmp.remaining(),
6854 )
6855 }
6856 for val in &self.key {
6857 __tmp.put_u8(*val);
6858 }
6859 if matches!(version, MavlinkVersion::V2) {
6860 let len = __tmp.len();
6861 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6862 } else {
6863 __tmp.len()
6864 }
6865 }
6866}
6867#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
6868#[doc = ""]
6869#[doc = "ID: 286"]
6870#[derive(Debug, Clone, PartialEq)]
6871#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6872#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6873#[cfg_attr(feature = "ts", derive(TS))]
6874#[cfg_attr(feature = "ts", ts(export))]
6875pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6876 #[doc = "Timestamp (time since system boot)."]
6877 pub time_boot_us: u64,
6878 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
6879 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6880 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
6881 pub q: [f32; 4],
6882 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
6883 pub q_estimated_delay_us: u32,
6884 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
6885 pub vx: f32,
6886 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
6887 pub vy: f32,
6888 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
6889 pub vz: f32,
6890 #[doc = "Estimated delay of the speed data. 0 if unknown."]
6891 pub v_estimated_delay_us: u32,
6892 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
6893 pub feed_forward_angular_velocity_z: f32,
6894 #[doc = "Bitmap indicating which estimator outputs are valid."]
6895 pub estimator_status: EstimatorStatusFlags,
6896 #[doc = "System ID"]
6897 pub target_system: u8,
6898 #[doc = "Component ID"]
6899 pub target_component: u8,
6900 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
6901 pub landed_state: MavLandedState,
6902 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
6903 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6904 pub angular_velocity_z: f32,
6905}
6906impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6907 pub const ENCODED_LEN: usize = 57usize;
6908 pub const DEFAULT: Self = Self {
6909 time_boot_us: 0_u64,
6910 q: [0.0_f32; 4usize],
6911 q_estimated_delay_us: 0_u32,
6912 vx: 0.0_f32,
6913 vy: 0.0_f32,
6914 vz: 0.0_f32,
6915 v_estimated_delay_us: 0_u32,
6916 feed_forward_angular_velocity_z: 0.0_f32,
6917 estimator_status: EstimatorStatusFlags::DEFAULT,
6918 target_system: 0_u8,
6919 target_component: 0_u8,
6920 landed_state: MavLandedState::DEFAULT,
6921 angular_velocity_z: 0.0_f32,
6922 };
6923 #[cfg(feature = "arbitrary")]
6924 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6925 use arbitrary::{Arbitrary, Unstructured};
6926 let mut buf = [0u8; 1024];
6927 rng.fill_bytes(&mut buf);
6928 let mut unstructured = Unstructured::new(&buf);
6929 Self::arbitrary(&mut unstructured).unwrap_or_default()
6930 }
6931}
6932impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6933 fn default() -> Self {
6934 Self::DEFAULT.clone()
6935 }
6936}
6937impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
6938 type Message = MavMessage;
6939 const ID: u32 = 286u32;
6940 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
6941 const EXTRA_CRC: u8 = 210u8;
6942 const ENCODED_LEN: usize = 57usize;
6943 fn deser(
6944 _version: MavlinkVersion,
6945 __input: &[u8],
6946 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6947 let avail_len = __input.len();
6948 let mut payload_buf = [0; Self::ENCODED_LEN];
6949 let mut buf = if avail_len < Self::ENCODED_LEN {
6950 payload_buf[0..avail_len].copy_from_slice(__input);
6951 Bytes::new(&payload_buf)
6952 } else {
6953 Bytes::new(__input)
6954 };
6955 let mut __struct = Self::default();
6956 __struct.time_boot_us = buf.get_u64_le()?;
6957 for v in &mut __struct.q {
6958 let val = buf.get_f32_le()?;
6959 *v = val;
6960 }
6961 __struct.q_estimated_delay_us = buf.get_u32_le()?;
6962 __struct.vx = buf.get_f32_le()?;
6963 __struct.vy = buf.get_f32_le()?;
6964 __struct.vz = buf.get_f32_le()?;
6965 __struct.v_estimated_delay_us = buf.get_u32_le()?;
6966 __struct.feed_forward_angular_velocity_z = buf.get_f32_le()?;
6967 let tmp = buf.get_u16_le()?;
6968 __struct.estimator_status = EstimatorStatusFlags::from_bits(
6969 tmp as <EstimatorStatusFlags as Flags>::Bits,
6970 )
6971 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6972 flag_type: "EstimatorStatusFlags",
6973 value: tmp as u64,
6974 })?;
6975 __struct.target_system = buf.get_u8()?;
6976 __struct.target_component = buf.get_u8()?;
6977 let tmp = buf.get_u8()?;
6978 __struct.landed_state =
6979 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6980 enum_type: "MavLandedState",
6981 value: tmp as u64,
6982 })?;
6983 __struct.angular_velocity_z = buf.get_f32_le()?;
6984 Ok(__struct)
6985 }
6986 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6987 let mut __tmp = BytesMut::new(bytes);
6988 #[allow(clippy::absurd_extreme_comparisons)]
6989 #[allow(unused_comparisons)]
6990 if __tmp.remaining() < Self::ENCODED_LEN {
6991 panic!(
6992 "buffer is too small (need {} bytes, but got {})",
6993 Self::ENCODED_LEN,
6994 __tmp.remaining(),
6995 )
6996 }
6997 __tmp.put_u64_le(self.time_boot_us);
6998 for val in &self.q {
6999 __tmp.put_f32_le(*val);
7000 }
7001 __tmp.put_u32_le(self.q_estimated_delay_us);
7002 __tmp.put_f32_le(self.vx);
7003 __tmp.put_f32_le(self.vy);
7004 __tmp.put_f32_le(self.vz);
7005 __tmp.put_u32_le(self.v_estimated_delay_us);
7006 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
7007 __tmp.put_u16_le(self.estimator_status.bits() as u16);
7008 __tmp.put_u8(self.target_system);
7009 __tmp.put_u8(self.target_component);
7010 __tmp.put_u8(self.landed_state as u8);
7011 if matches!(version, MavlinkVersion::V2) {
7012 __tmp.put_f32_le(self.angular_velocity_z);
7013 let len = __tmp.len();
7014 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7015 } else {
7016 __tmp.len()
7017 }
7018 }
7019}
7020#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
7021#[doc = ""]
7022#[doc = "ID: 148"]
7023#[derive(Debug, Clone, PartialEq)]
7024#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7025#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7026#[cfg_attr(feature = "ts", derive(TS))]
7027#[cfg_attr(feature = "ts", ts(export))]
7028pub struct AUTOPILOT_VERSION_DATA {
7029 #[doc = "Bitmap of capabilities"]
7030 pub capabilities: MavProtocolCapability,
7031 #[doc = "UID if provided by hardware (see uid2)"]
7032 pub uid: u64,
7033 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
7034 pub flight_sw_version: u32,
7035 #[doc = "Middleware version number"]
7036 pub middleware_sw_version: u32,
7037 #[doc = "Operating system version number"]
7038 pub os_sw_version: u32,
7039 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
7040 pub board_version: u32,
7041 #[doc = "ID of the board vendor"]
7042 pub vendor_id: u16,
7043 #[doc = "ID of the product"]
7044 pub product_id: u16,
7045 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
7046 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7047 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7048 pub flight_custom_version: [u8; 8],
7049 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
7050 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7051 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7052 pub middleware_custom_version: [u8; 8],
7053 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
7054 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7055 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7056 pub os_custom_version: [u8; 8],
7057 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
7058 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7059 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7060 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7061 pub uid2: [u8; 18],
7062}
7063impl AUTOPILOT_VERSION_DATA {
7064 pub const ENCODED_LEN: usize = 78usize;
7065 pub const DEFAULT: Self = Self {
7066 capabilities: MavProtocolCapability::DEFAULT,
7067 uid: 0_u64,
7068 flight_sw_version: 0_u32,
7069 middleware_sw_version: 0_u32,
7070 os_sw_version: 0_u32,
7071 board_version: 0_u32,
7072 vendor_id: 0_u16,
7073 product_id: 0_u16,
7074 flight_custom_version: [0_u8; 8usize],
7075 middleware_custom_version: [0_u8; 8usize],
7076 os_custom_version: [0_u8; 8usize],
7077 uid2: [0_u8; 18usize],
7078 };
7079 #[cfg(feature = "arbitrary")]
7080 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7081 use arbitrary::{Arbitrary, Unstructured};
7082 let mut buf = [0u8; 1024];
7083 rng.fill_bytes(&mut buf);
7084 let mut unstructured = Unstructured::new(&buf);
7085 Self::arbitrary(&mut unstructured).unwrap_or_default()
7086 }
7087}
7088impl Default for AUTOPILOT_VERSION_DATA {
7089 fn default() -> Self {
7090 Self::DEFAULT.clone()
7091 }
7092}
7093impl MessageData for AUTOPILOT_VERSION_DATA {
7094 type Message = MavMessage;
7095 const ID: u32 = 148u32;
7096 const NAME: &'static str = "AUTOPILOT_VERSION";
7097 const EXTRA_CRC: u8 = 178u8;
7098 const ENCODED_LEN: usize = 78usize;
7099 fn deser(
7100 _version: MavlinkVersion,
7101 __input: &[u8],
7102 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7103 let avail_len = __input.len();
7104 let mut payload_buf = [0; Self::ENCODED_LEN];
7105 let mut buf = if avail_len < Self::ENCODED_LEN {
7106 payload_buf[0..avail_len].copy_from_slice(__input);
7107 Bytes::new(&payload_buf)
7108 } else {
7109 Bytes::new(__input)
7110 };
7111 let mut __struct = Self::default();
7112 let tmp = buf.get_u64_le()?;
7113 __struct.capabilities = MavProtocolCapability::from_bits(
7114 tmp as <MavProtocolCapability as Flags>::Bits,
7115 )
7116 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7117 flag_type: "MavProtocolCapability",
7118 value: tmp as u64,
7119 })?;
7120 __struct.uid = buf.get_u64_le()?;
7121 __struct.flight_sw_version = buf.get_u32_le()?;
7122 __struct.middleware_sw_version = buf.get_u32_le()?;
7123 __struct.os_sw_version = buf.get_u32_le()?;
7124 __struct.board_version = buf.get_u32_le()?;
7125 __struct.vendor_id = buf.get_u16_le()?;
7126 __struct.product_id = buf.get_u16_le()?;
7127 for v in &mut __struct.flight_custom_version {
7128 let val = buf.get_u8()?;
7129 *v = val;
7130 }
7131 for v in &mut __struct.middleware_custom_version {
7132 let val = buf.get_u8()?;
7133 *v = val;
7134 }
7135 for v in &mut __struct.os_custom_version {
7136 let val = buf.get_u8()?;
7137 *v = val;
7138 }
7139 for v in &mut __struct.uid2 {
7140 let val = buf.get_u8()?;
7141 *v = val;
7142 }
7143 Ok(__struct)
7144 }
7145 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7146 let mut __tmp = BytesMut::new(bytes);
7147 #[allow(clippy::absurd_extreme_comparisons)]
7148 #[allow(unused_comparisons)]
7149 if __tmp.remaining() < Self::ENCODED_LEN {
7150 panic!(
7151 "buffer is too small (need {} bytes, but got {})",
7152 Self::ENCODED_LEN,
7153 __tmp.remaining(),
7154 )
7155 }
7156 __tmp.put_u64_le(self.capabilities.bits() as u64);
7157 __tmp.put_u64_le(self.uid);
7158 __tmp.put_u32_le(self.flight_sw_version);
7159 __tmp.put_u32_le(self.middleware_sw_version);
7160 __tmp.put_u32_le(self.os_sw_version);
7161 __tmp.put_u32_le(self.board_version);
7162 __tmp.put_u16_le(self.vendor_id);
7163 __tmp.put_u16_le(self.product_id);
7164 for val in &self.flight_custom_version {
7165 __tmp.put_u8(*val);
7166 }
7167 for val in &self.middleware_custom_version {
7168 __tmp.put_u8(*val);
7169 }
7170 for val in &self.os_custom_version {
7171 __tmp.put_u8(*val);
7172 }
7173 if matches!(version, MavlinkVersion::V2) {
7174 for val in &self.uid2 {
7175 __tmp.put_u8(*val);
7176 }
7177 let len = __tmp.len();
7178 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7179 } else {
7180 __tmp.len()
7181 }
7182 }
7183}
7184#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
7185#[doc = ""]
7186#[doc = "ID: 435"]
7187#[derive(Debug, Clone, PartialEq)]
7188#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7189#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7190#[cfg_attr(feature = "ts", derive(TS))]
7191#[cfg_attr(feature = "ts", ts(export))]
7192pub struct AVAILABLE_MODES_DATA {
7193 #[doc = "A bitfield for use for autopilot-specific flags"]
7194 pub custom_mode: u32,
7195 #[doc = "Mode properties."]
7196 pub properties: MavModeProperty,
7197 #[doc = "The total number of available modes for the current vehicle type."]
7198 pub number_modes: u8,
7199 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
7200 pub mode_index: u8,
7201 #[doc = "Standard mode."]
7202 pub standard_mode: MavStandardMode,
7203 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
7204 #[cfg_attr(feature = "ts", ts(type = "string"))]
7205 pub mode_name: CharArray<35>,
7206}
7207impl AVAILABLE_MODES_DATA {
7208 pub const ENCODED_LEN: usize = 46usize;
7209 pub const DEFAULT: Self = Self {
7210 custom_mode: 0_u32,
7211 properties: MavModeProperty::DEFAULT,
7212 number_modes: 0_u8,
7213 mode_index: 0_u8,
7214 standard_mode: MavStandardMode::DEFAULT,
7215 mode_name: CharArray::new([0_u8; 35usize]),
7216 };
7217 #[cfg(feature = "arbitrary")]
7218 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7219 use arbitrary::{Arbitrary, Unstructured};
7220 let mut buf = [0u8; 1024];
7221 rng.fill_bytes(&mut buf);
7222 let mut unstructured = Unstructured::new(&buf);
7223 Self::arbitrary(&mut unstructured).unwrap_or_default()
7224 }
7225}
7226impl Default for AVAILABLE_MODES_DATA {
7227 fn default() -> Self {
7228 Self::DEFAULT.clone()
7229 }
7230}
7231impl MessageData for AVAILABLE_MODES_DATA {
7232 type Message = MavMessage;
7233 const ID: u32 = 435u32;
7234 const NAME: &'static str = "AVAILABLE_MODES";
7235 const EXTRA_CRC: u8 = 134u8;
7236 const ENCODED_LEN: usize = 46usize;
7237 fn deser(
7238 _version: MavlinkVersion,
7239 __input: &[u8],
7240 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7241 let avail_len = __input.len();
7242 let mut payload_buf = [0; Self::ENCODED_LEN];
7243 let mut buf = if avail_len < Self::ENCODED_LEN {
7244 payload_buf[0..avail_len].copy_from_slice(__input);
7245 Bytes::new(&payload_buf)
7246 } else {
7247 Bytes::new(__input)
7248 };
7249 let mut __struct = Self::default();
7250 __struct.custom_mode = buf.get_u32_le()?;
7251 let tmp = buf.get_u32_le()?;
7252 __struct.properties = MavModeProperty::from_bits(tmp as <MavModeProperty as Flags>::Bits)
7253 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7254 flag_type: "MavModeProperty",
7255 value: tmp as u64,
7256 })?;
7257 __struct.number_modes = buf.get_u8()?;
7258 __struct.mode_index = buf.get_u8()?;
7259 let tmp = buf.get_u8()?;
7260 __struct.standard_mode =
7261 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7262 enum_type: "MavStandardMode",
7263 value: tmp as u64,
7264 })?;
7265 let mut tmp = [0_u8; 35usize];
7266 for v in &mut tmp {
7267 *v = buf.get_u8()?;
7268 }
7269 __struct.mode_name = CharArray::new(tmp);
7270 Ok(__struct)
7271 }
7272 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7273 let mut __tmp = BytesMut::new(bytes);
7274 #[allow(clippy::absurd_extreme_comparisons)]
7275 #[allow(unused_comparisons)]
7276 if __tmp.remaining() < Self::ENCODED_LEN {
7277 panic!(
7278 "buffer is too small (need {} bytes, but got {})",
7279 Self::ENCODED_LEN,
7280 __tmp.remaining(),
7281 )
7282 }
7283 __tmp.put_u32_le(self.custom_mode);
7284 __tmp.put_u32_le(self.properties.bits() as u32);
7285 __tmp.put_u8(self.number_modes);
7286 __tmp.put_u8(self.mode_index);
7287 __tmp.put_u8(self.standard_mode as u8);
7288 for val in &self.mode_name {
7289 __tmp.put_u8(*val);
7290 }
7291 if matches!(version, MavlinkVersion::V2) {
7292 let len = __tmp.len();
7293 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7294 } else {
7295 __tmp.len()
7296 }
7297 }
7298}
7299#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
7300#[doc = ""]
7301#[doc = "ID: 437"]
7302#[derive(Debug, Clone, PartialEq)]
7303#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7304#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7305#[cfg_attr(feature = "ts", derive(TS))]
7306#[cfg_attr(feature = "ts", ts(export))]
7307pub struct AVAILABLE_MODES_MONITOR_DATA {
7308 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
7309 pub seq: u8,
7310}
7311impl AVAILABLE_MODES_MONITOR_DATA {
7312 pub const ENCODED_LEN: usize = 1usize;
7313 pub const DEFAULT: Self = Self { seq: 0_u8 };
7314 #[cfg(feature = "arbitrary")]
7315 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7316 use arbitrary::{Arbitrary, Unstructured};
7317 let mut buf = [0u8; 1024];
7318 rng.fill_bytes(&mut buf);
7319 let mut unstructured = Unstructured::new(&buf);
7320 Self::arbitrary(&mut unstructured).unwrap_or_default()
7321 }
7322}
7323impl Default for AVAILABLE_MODES_MONITOR_DATA {
7324 fn default() -> Self {
7325 Self::DEFAULT.clone()
7326 }
7327}
7328impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
7329 type Message = MavMessage;
7330 const ID: u32 = 437u32;
7331 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
7332 const EXTRA_CRC: u8 = 30u8;
7333 const ENCODED_LEN: usize = 1usize;
7334 fn deser(
7335 _version: MavlinkVersion,
7336 __input: &[u8],
7337 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7338 let avail_len = __input.len();
7339 let mut payload_buf = [0; Self::ENCODED_LEN];
7340 let mut buf = if avail_len < Self::ENCODED_LEN {
7341 payload_buf[0..avail_len].copy_from_slice(__input);
7342 Bytes::new(&payload_buf)
7343 } else {
7344 Bytes::new(__input)
7345 };
7346 let mut __struct = Self::default();
7347 __struct.seq = buf.get_u8()?;
7348 Ok(__struct)
7349 }
7350 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7351 let mut __tmp = BytesMut::new(bytes);
7352 #[allow(clippy::absurd_extreme_comparisons)]
7353 #[allow(unused_comparisons)]
7354 if __tmp.remaining() < Self::ENCODED_LEN {
7355 panic!(
7356 "buffer is too small (need {} bytes, but got {})",
7357 Self::ENCODED_LEN,
7358 __tmp.remaining(),
7359 )
7360 }
7361 __tmp.put_u8(self.seq);
7362 if matches!(version, MavlinkVersion::V2) {
7363 let len = __tmp.len();
7364 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7365 } else {
7366 __tmp.len()
7367 }
7368 }
7369}
7370#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
7371#[doc = ""]
7372#[doc = "ID: 372"]
7373#[derive(Debug, Clone, PartialEq)]
7374#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7375#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7376#[cfg_attr(feature = "ts", derive(TS))]
7377#[cfg_attr(feature = "ts", ts(export))]
7378pub struct BATTERY_INFO_DATA {
7379 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
7380 pub discharge_minimum_voltage: f32,
7381 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
7382 pub charging_minimum_voltage: f32,
7383 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
7384 pub resting_minimum_voltage: f32,
7385 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
7386 pub charging_maximum_voltage: f32,
7387 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
7388 pub charging_maximum_current: f32,
7389 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
7390 pub nominal_voltage: f32,
7391 #[doc = "Maximum pack discharge current. 0: field not provided."]
7392 pub discharge_maximum_current: f32,
7393 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
7394 pub discharge_maximum_burst_current: f32,
7395 #[doc = "Fully charged design capacity. 0: field not provided."]
7396 pub design_capacity: f32,
7397 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
7398 pub full_charge_capacity: f32,
7399 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
7400 pub cycle_count: u16,
7401 #[doc = "Battery weight. 0: field not provided."]
7402 pub weight: u16,
7403 #[doc = "Battery ID"]
7404 pub id: u8,
7405 #[doc = "Function of the battery."]
7406 pub battery_function: MavBatteryFunction,
7407 #[doc = "Type (chemistry) of the battery."]
7408 pub mavtype: MavBatteryType,
7409 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
7410 pub state_of_health: u8,
7411 #[doc = "Number of battery cells in series. 0: field not provided."]
7412 pub cells_in_series: u8,
7413 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
7414 #[cfg_attr(feature = "ts", ts(type = "string"))]
7415 pub manufacture_date: CharArray<9>,
7416 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
7417 #[cfg_attr(feature = "ts", ts(type = "string"))]
7418 pub serial_number: CharArray<32>,
7419 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
7420 #[cfg_attr(feature = "ts", ts(type = "string"))]
7421 pub name: CharArray<50>,
7422}
7423impl BATTERY_INFO_DATA {
7424 pub const ENCODED_LEN: usize = 140usize;
7425 pub const DEFAULT: Self = Self {
7426 discharge_minimum_voltage: 0.0_f32,
7427 charging_minimum_voltage: 0.0_f32,
7428 resting_minimum_voltage: 0.0_f32,
7429 charging_maximum_voltage: 0.0_f32,
7430 charging_maximum_current: 0.0_f32,
7431 nominal_voltage: 0.0_f32,
7432 discharge_maximum_current: 0.0_f32,
7433 discharge_maximum_burst_current: 0.0_f32,
7434 design_capacity: 0.0_f32,
7435 full_charge_capacity: 0.0_f32,
7436 cycle_count: 0_u16,
7437 weight: 0_u16,
7438 id: 0_u8,
7439 battery_function: MavBatteryFunction::DEFAULT,
7440 mavtype: MavBatteryType::DEFAULT,
7441 state_of_health: 0_u8,
7442 cells_in_series: 0_u8,
7443 manufacture_date: CharArray::new([0_u8; 9usize]),
7444 serial_number: CharArray::new([0_u8; 32usize]),
7445 name: CharArray::new([0_u8; 50usize]),
7446 };
7447 #[cfg(feature = "arbitrary")]
7448 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7449 use arbitrary::{Arbitrary, Unstructured};
7450 let mut buf = [0u8; 1024];
7451 rng.fill_bytes(&mut buf);
7452 let mut unstructured = Unstructured::new(&buf);
7453 Self::arbitrary(&mut unstructured).unwrap_or_default()
7454 }
7455}
7456impl Default for BATTERY_INFO_DATA {
7457 fn default() -> Self {
7458 Self::DEFAULT.clone()
7459 }
7460}
7461impl MessageData for BATTERY_INFO_DATA {
7462 type Message = MavMessage;
7463 const ID: u32 = 372u32;
7464 const NAME: &'static str = "BATTERY_INFO";
7465 const EXTRA_CRC: u8 = 26u8;
7466 const ENCODED_LEN: usize = 140usize;
7467 fn deser(
7468 _version: MavlinkVersion,
7469 __input: &[u8],
7470 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7471 let avail_len = __input.len();
7472 let mut payload_buf = [0; Self::ENCODED_LEN];
7473 let mut buf = if avail_len < Self::ENCODED_LEN {
7474 payload_buf[0..avail_len].copy_from_slice(__input);
7475 Bytes::new(&payload_buf)
7476 } else {
7477 Bytes::new(__input)
7478 };
7479 let mut __struct = Self::default();
7480 __struct.discharge_minimum_voltage = buf.get_f32_le()?;
7481 __struct.charging_minimum_voltage = buf.get_f32_le()?;
7482 __struct.resting_minimum_voltage = buf.get_f32_le()?;
7483 __struct.charging_maximum_voltage = buf.get_f32_le()?;
7484 __struct.charging_maximum_current = buf.get_f32_le()?;
7485 __struct.nominal_voltage = buf.get_f32_le()?;
7486 __struct.discharge_maximum_current = buf.get_f32_le()?;
7487 __struct.discharge_maximum_burst_current = buf.get_f32_le()?;
7488 __struct.design_capacity = buf.get_f32_le()?;
7489 __struct.full_charge_capacity = buf.get_f32_le()?;
7490 __struct.cycle_count = buf.get_u16_le()?;
7491 __struct.weight = buf.get_u16_le()?;
7492 __struct.id = buf.get_u8()?;
7493 let tmp = buf.get_u8()?;
7494 __struct.battery_function =
7495 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7496 enum_type: "MavBatteryFunction",
7497 value: tmp as u64,
7498 })?;
7499 let tmp = buf.get_u8()?;
7500 __struct.mavtype =
7501 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7502 enum_type: "MavBatteryType",
7503 value: tmp as u64,
7504 })?;
7505 __struct.state_of_health = buf.get_u8()?;
7506 __struct.cells_in_series = buf.get_u8()?;
7507 let mut tmp = [0_u8; 9usize];
7508 for v in &mut tmp {
7509 *v = buf.get_u8()?;
7510 }
7511 __struct.manufacture_date = CharArray::new(tmp);
7512 let mut tmp = [0_u8; 32usize];
7513 for v in &mut tmp {
7514 *v = buf.get_u8()?;
7515 }
7516 __struct.serial_number = CharArray::new(tmp);
7517 let mut tmp = [0_u8; 50usize];
7518 for v in &mut tmp {
7519 *v = buf.get_u8()?;
7520 }
7521 __struct.name = CharArray::new(tmp);
7522 Ok(__struct)
7523 }
7524 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7525 let mut __tmp = BytesMut::new(bytes);
7526 #[allow(clippy::absurd_extreme_comparisons)]
7527 #[allow(unused_comparisons)]
7528 if __tmp.remaining() < Self::ENCODED_LEN {
7529 panic!(
7530 "buffer is too small (need {} bytes, but got {})",
7531 Self::ENCODED_LEN,
7532 __tmp.remaining(),
7533 )
7534 }
7535 __tmp.put_f32_le(self.discharge_minimum_voltage);
7536 __tmp.put_f32_le(self.charging_minimum_voltage);
7537 __tmp.put_f32_le(self.resting_minimum_voltage);
7538 __tmp.put_f32_le(self.charging_maximum_voltage);
7539 __tmp.put_f32_le(self.charging_maximum_current);
7540 __tmp.put_f32_le(self.nominal_voltage);
7541 __tmp.put_f32_le(self.discharge_maximum_current);
7542 __tmp.put_f32_le(self.discharge_maximum_burst_current);
7543 __tmp.put_f32_le(self.design_capacity);
7544 __tmp.put_f32_le(self.full_charge_capacity);
7545 __tmp.put_u16_le(self.cycle_count);
7546 __tmp.put_u16_le(self.weight);
7547 __tmp.put_u8(self.id);
7548 __tmp.put_u8(self.battery_function as u8);
7549 __tmp.put_u8(self.mavtype as u8);
7550 __tmp.put_u8(self.state_of_health);
7551 __tmp.put_u8(self.cells_in_series);
7552 for val in &self.manufacture_date {
7553 __tmp.put_u8(*val);
7554 }
7555 for val in &self.serial_number {
7556 __tmp.put_u8(*val);
7557 }
7558 for val in &self.name {
7559 __tmp.put_u8(*val);
7560 }
7561 if matches!(version, MavlinkVersion::V2) {
7562 let len = __tmp.len();
7563 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7564 } else {
7565 __tmp.len()
7566 }
7567 }
7568}
7569#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
7570#[doc = ""]
7571#[doc = "ID: 147"]
7572#[derive(Debug, Clone, PartialEq)]
7573#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7574#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7575#[cfg_attr(feature = "ts", derive(TS))]
7576#[cfg_attr(feature = "ts", ts(export))]
7577pub struct BATTERY_STATUS_DATA {
7578 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
7579 pub current_consumed: i32,
7580 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
7581 pub energy_consumed: i32,
7582 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
7583 pub temperature: i16,
7584 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
7585 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7586 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7587 pub voltages: [u16; 10],
7588 #[doc = "Battery current, -1: autopilot does not measure the current"]
7589 pub current_battery: i16,
7590 #[doc = "Battery ID"]
7591 pub id: u8,
7592 #[doc = "Function of the battery"]
7593 pub battery_function: MavBatteryFunction,
7594 #[doc = "Type (chemistry) of the battery"]
7595 pub mavtype: MavBatteryType,
7596 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
7597 pub battery_remaining: i8,
7598 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
7599 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7600 pub time_remaining: i32,
7601 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
7602 #[cfg_attr(feature = "serde", serde(default))]
7603 pub charge_state: MavBatteryChargeState,
7604 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
7605 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7606 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7607 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7608 pub voltages_ext: [u16; 4],
7609 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
7610 #[cfg_attr(feature = "serde", serde(default))]
7611 pub mode: MavBatteryMode,
7612 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
7613 #[cfg_attr(feature = "serde", serde(default))]
7614 pub fault_bitmask: MavBatteryFault,
7615}
7616impl BATTERY_STATUS_DATA {
7617 pub const ENCODED_LEN: usize = 54usize;
7618 pub const DEFAULT: Self = Self {
7619 current_consumed: 0_i32,
7620 energy_consumed: 0_i32,
7621 temperature: 0_i16,
7622 voltages: [0_u16; 10usize],
7623 current_battery: 0_i16,
7624 id: 0_u8,
7625 battery_function: MavBatteryFunction::DEFAULT,
7626 mavtype: MavBatteryType::DEFAULT,
7627 battery_remaining: 0_i8,
7628 time_remaining: 0_i32,
7629 charge_state: MavBatteryChargeState::DEFAULT,
7630 voltages_ext: [0_u16; 4usize],
7631 mode: MavBatteryMode::DEFAULT,
7632 fault_bitmask: MavBatteryFault::DEFAULT,
7633 };
7634 #[cfg(feature = "arbitrary")]
7635 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7636 use arbitrary::{Arbitrary, Unstructured};
7637 let mut buf = [0u8; 1024];
7638 rng.fill_bytes(&mut buf);
7639 let mut unstructured = Unstructured::new(&buf);
7640 Self::arbitrary(&mut unstructured).unwrap_or_default()
7641 }
7642}
7643impl Default for BATTERY_STATUS_DATA {
7644 fn default() -> Self {
7645 Self::DEFAULT.clone()
7646 }
7647}
7648impl MessageData for BATTERY_STATUS_DATA {
7649 type Message = MavMessage;
7650 const ID: u32 = 147u32;
7651 const NAME: &'static str = "BATTERY_STATUS";
7652 const EXTRA_CRC: u8 = 154u8;
7653 const ENCODED_LEN: usize = 54usize;
7654 fn deser(
7655 _version: MavlinkVersion,
7656 __input: &[u8],
7657 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7658 let avail_len = __input.len();
7659 let mut payload_buf = [0; Self::ENCODED_LEN];
7660 let mut buf = if avail_len < Self::ENCODED_LEN {
7661 payload_buf[0..avail_len].copy_from_slice(__input);
7662 Bytes::new(&payload_buf)
7663 } else {
7664 Bytes::new(__input)
7665 };
7666 let mut __struct = Self::default();
7667 __struct.current_consumed = buf.get_i32_le()?;
7668 __struct.energy_consumed = buf.get_i32_le()?;
7669 __struct.temperature = buf.get_i16_le()?;
7670 for v in &mut __struct.voltages {
7671 let val = buf.get_u16_le()?;
7672 *v = val;
7673 }
7674 __struct.current_battery = buf.get_i16_le()?;
7675 __struct.id = buf.get_u8()?;
7676 let tmp = buf.get_u8()?;
7677 __struct.battery_function =
7678 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7679 enum_type: "MavBatteryFunction",
7680 value: tmp as u64,
7681 })?;
7682 let tmp = buf.get_u8()?;
7683 __struct.mavtype =
7684 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7685 enum_type: "MavBatteryType",
7686 value: tmp as u64,
7687 })?;
7688 __struct.battery_remaining = buf.get_i8()?;
7689 __struct.time_remaining = buf.get_i32_le()?;
7690 let tmp = buf.get_u8()?;
7691 __struct.charge_state =
7692 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7693 enum_type: "MavBatteryChargeState",
7694 value: tmp as u64,
7695 })?;
7696 for v in &mut __struct.voltages_ext {
7697 let val = buf.get_u16_le()?;
7698 *v = val;
7699 }
7700 let tmp = buf.get_u8()?;
7701 __struct.mode =
7702 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7703 enum_type: "MavBatteryMode",
7704 value: tmp as u64,
7705 })?;
7706 let tmp = buf.get_u32_le()?;
7707 __struct.fault_bitmask = MavBatteryFault::from_bits(
7708 tmp as <MavBatteryFault as Flags>::Bits,
7709 )
7710 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7711 flag_type: "MavBatteryFault",
7712 value: tmp as u64,
7713 })?;
7714 Ok(__struct)
7715 }
7716 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7717 let mut __tmp = BytesMut::new(bytes);
7718 #[allow(clippy::absurd_extreme_comparisons)]
7719 #[allow(unused_comparisons)]
7720 if __tmp.remaining() < Self::ENCODED_LEN {
7721 panic!(
7722 "buffer is too small (need {} bytes, but got {})",
7723 Self::ENCODED_LEN,
7724 __tmp.remaining(),
7725 )
7726 }
7727 __tmp.put_i32_le(self.current_consumed);
7728 __tmp.put_i32_le(self.energy_consumed);
7729 __tmp.put_i16_le(self.temperature);
7730 for val in &self.voltages {
7731 __tmp.put_u16_le(*val);
7732 }
7733 __tmp.put_i16_le(self.current_battery);
7734 __tmp.put_u8(self.id);
7735 __tmp.put_u8(self.battery_function as u8);
7736 __tmp.put_u8(self.mavtype as u8);
7737 __tmp.put_i8(self.battery_remaining);
7738 if matches!(version, MavlinkVersion::V2) {
7739 __tmp.put_i32_le(self.time_remaining);
7740 __tmp.put_u8(self.charge_state as u8);
7741 for val in &self.voltages_ext {
7742 __tmp.put_u16_le(*val);
7743 }
7744 __tmp.put_u8(self.mode as u8);
7745 __tmp.put_u32_le(self.fault_bitmask.bits() as u32);
7746 let len = __tmp.len();
7747 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7748 } else {
7749 __tmp.len()
7750 }
7751 }
7752}
7753#[doc = "Report button state change."]
7754#[doc = ""]
7755#[doc = "ID: 257"]
7756#[derive(Debug, Clone, PartialEq)]
7757#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7758#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7759#[cfg_attr(feature = "ts", derive(TS))]
7760#[cfg_attr(feature = "ts", ts(export))]
7761pub struct BUTTON_CHANGE_DATA {
7762 #[doc = "Timestamp (time since system boot)."]
7763 pub time_boot_ms: u32,
7764 #[doc = "Time of last change of button state."]
7765 pub last_change_ms: u32,
7766 #[doc = "Bitmap for state of buttons."]
7767 pub state: u8,
7768}
7769impl BUTTON_CHANGE_DATA {
7770 pub const ENCODED_LEN: usize = 9usize;
7771 pub const DEFAULT: Self = Self {
7772 time_boot_ms: 0_u32,
7773 last_change_ms: 0_u32,
7774 state: 0_u8,
7775 };
7776 #[cfg(feature = "arbitrary")]
7777 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7778 use arbitrary::{Arbitrary, Unstructured};
7779 let mut buf = [0u8; 1024];
7780 rng.fill_bytes(&mut buf);
7781 let mut unstructured = Unstructured::new(&buf);
7782 Self::arbitrary(&mut unstructured).unwrap_or_default()
7783 }
7784}
7785impl Default for BUTTON_CHANGE_DATA {
7786 fn default() -> Self {
7787 Self::DEFAULT.clone()
7788 }
7789}
7790impl MessageData for BUTTON_CHANGE_DATA {
7791 type Message = MavMessage;
7792 const ID: u32 = 257u32;
7793 const NAME: &'static str = "BUTTON_CHANGE";
7794 const EXTRA_CRC: u8 = 131u8;
7795 const ENCODED_LEN: usize = 9usize;
7796 fn deser(
7797 _version: MavlinkVersion,
7798 __input: &[u8],
7799 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7800 let avail_len = __input.len();
7801 let mut payload_buf = [0; Self::ENCODED_LEN];
7802 let mut buf = if avail_len < Self::ENCODED_LEN {
7803 payload_buf[0..avail_len].copy_from_slice(__input);
7804 Bytes::new(&payload_buf)
7805 } else {
7806 Bytes::new(__input)
7807 };
7808 let mut __struct = Self::default();
7809 __struct.time_boot_ms = buf.get_u32_le()?;
7810 __struct.last_change_ms = buf.get_u32_le()?;
7811 __struct.state = buf.get_u8()?;
7812 Ok(__struct)
7813 }
7814 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7815 let mut __tmp = BytesMut::new(bytes);
7816 #[allow(clippy::absurd_extreme_comparisons)]
7817 #[allow(unused_comparisons)]
7818 if __tmp.remaining() < Self::ENCODED_LEN {
7819 panic!(
7820 "buffer is too small (need {} bytes, but got {})",
7821 Self::ENCODED_LEN,
7822 __tmp.remaining(),
7823 )
7824 }
7825 __tmp.put_u32_le(self.time_boot_ms);
7826 __tmp.put_u32_le(self.last_change_ms);
7827 __tmp.put_u8(self.state);
7828 if matches!(version, MavlinkVersion::V2) {
7829 let len = __tmp.len();
7830 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7831 } else {
7832 __tmp.len()
7833 }
7834 }
7835}
7836#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7837#[doc = ""]
7838#[doc = "ID: 262"]
7839#[derive(Debug, Clone, PartialEq)]
7840#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7841#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7842#[cfg_attr(feature = "ts", derive(TS))]
7843#[cfg_attr(feature = "ts", ts(export))]
7844pub struct CAMERA_CAPTURE_STATUS_DATA {
7845 #[doc = "Timestamp (time since system boot)."]
7846 pub time_boot_ms: u32,
7847 #[doc = "Image capture interval"]
7848 pub image_interval: f32,
7849 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
7850 pub recording_time_ms: u32,
7851 #[doc = "Available storage capacity."]
7852 pub available_capacity: f32,
7853 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
7854 pub image_status: u8,
7855 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
7856 pub video_status: u8,
7857 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
7858 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7859 pub image_count: i32,
7860 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7861 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7862 pub camera_device_id: u8,
7863}
7864impl CAMERA_CAPTURE_STATUS_DATA {
7865 pub const ENCODED_LEN: usize = 23usize;
7866 pub const DEFAULT: Self = Self {
7867 time_boot_ms: 0_u32,
7868 image_interval: 0.0_f32,
7869 recording_time_ms: 0_u32,
7870 available_capacity: 0.0_f32,
7871 image_status: 0_u8,
7872 video_status: 0_u8,
7873 image_count: 0_i32,
7874 camera_device_id: 0_u8,
7875 };
7876 #[cfg(feature = "arbitrary")]
7877 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7878 use arbitrary::{Arbitrary, Unstructured};
7879 let mut buf = [0u8; 1024];
7880 rng.fill_bytes(&mut buf);
7881 let mut unstructured = Unstructured::new(&buf);
7882 Self::arbitrary(&mut unstructured).unwrap_or_default()
7883 }
7884}
7885impl Default for CAMERA_CAPTURE_STATUS_DATA {
7886 fn default() -> Self {
7887 Self::DEFAULT.clone()
7888 }
7889}
7890impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
7891 type Message = MavMessage;
7892 const ID: u32 = 262u32;
7893 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
7894 const EXTRA_CRC: u8 = 12u8;
7895 const ENCODED_LEN: usize = 23usize;
7896 fn deser(
7897 _version: MavlinkVersion,
7898 __input: &[u8],
7899 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7900 let avail_len = __input.len();
7901 let mut payload_buf = [0; Self::ENCODED_LEN];
7902 let mut buf = if avail_len < Self::ENCODED_LEN {
7903 payload_buf[0..avail_len].copy_from_slice(__input);
7904 Bytes::new(&payload_buf)
7905 } else {
7906 Bytes::new(__input)
7907 };
7908 let mut __struct = Self::default();
7909 __struct.time_boot_ms = buf.get_u32_le()?;
7910 __struct.image_interval = buf.get_f32_le()?;
7911 __struct.recording_time_ms = buf.get_u32_le()?;
7912 __struct.available_capacity = buf.get_f32_le()?;
7913 __struct.image_status = buf.get_u8()?;
7914 __struct.video_status = buf.get_u8()?;
7915 __struct.image_count = buf.get_i32_le()?;
7916 __struct.camera_device_id = buf.get_u8()?;
7917 Ok(__struct)
7918 }
7919 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7920 let mut __tmp = BytesMut::new(bytes);
7921 #[allow(clippy::absurd_extreme_comparisons)]
7922 #[allow(unused_comparisons)]
7923 if __tmp.remaining() < Self::ENCODED_LEN {
7924 panic!(
7925 "buffer is too small (need {} bytes, but got {})",
7926 Self::ENCODED_LEN,
7927 __tmp.remaining(),
7928 )
7929 }
7930 __tmp.put_u32_le(self.time_boot_ms);
7931 __tmp.put_f32_le(self.image_interval);
7932 __tmp.put_u32_le(self.recording_time_ms);
7933 __tmp.put_f32_le(self.available_capacity);
7934 __tmp.put_u8(self.image_status);
7935 __tmp.put_u8(self.video_status);
7936 if matches!(version, MavlinkVersion::V2) {
7937 __tmp.put_i32_le(self.image_count);
7938 __tmp.put_u8(self.camera_device_id);
7939 let len = __tmp.len();
7940 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7941 } else {
7942 __tmp.len()
7943 }
7944 }
7945}
7946#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7947#[doc = ""]
7948#[doc = "ID: 271"]
7949#[derive(Debug, Clone, PartialEq)]
7950#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7951#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7952#[cfg_attr(feature = "ts", derive(TS))]
7953#[cfg_attr(feature = "ts", ts(export))]
7954pub struct CAMERA_FOV_STATUS_DATA {
7955 #[doc = "Timestamp (time since system boot)."]
7956 pub time_boot_ms: u32,
7957 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
7958 pub lat_camera: i32,
7959 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
7960 pub lon_camera: i32,
7961 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
7962 pub alt_camera: i32,
7963 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7964 pub lat_image: i32,
7965 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7966 pub lon_image: i32,
7967 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7968 pub alt_image: i32,
7969 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7970 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7971 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
7972 pub q: [f32; 4],
7973 #[doc = "Horizontal field of view (NaN if unknown)."]
7974 pub hfov: f32,
7975 #[doc = "Vertical field of view (NaN if unknown)."]
7976 pub vfov: f32,
7977 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7978 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7979 pub camera_device_id: u8,
7980}
7981impl CAMERA_FOV_STATUS_DATA {
7982 pub const ENCODED_LEN: usize = 53usize;
7983 pub const DEFAULT: Self = Self {
7984 time_boot_ms: 0_u32,
7985 lat_camera: 0_i32,
7986 lon_camera: 0_i32,
7987 alt_camera: 0_i32,
7988 lat_image: 0_i32,
7989 lon_image: 0_i32,
7990 alt_image: 0_i32,
7991 q: [0.0_f32; 4usize],
7992 hfov: 0.0_f32,
7993 vfov: 0.0_f32,
7994 camera_device_id: 0_u8,
7995 };
7996 #[cfg(feature = "arbitrary")]
7997 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7998 use arbitrary::{Arbitrary, Unstructured};
7999 let mut buf = [0u8; 1024];
8000 rng.fill_bytes(&mut buf);
8001 let mut unstructured = Unstructured::new(&buf);
8002 Self::arbitrary(&mut unstructured).unwrap_or_default()
8003 }
8004}
8005impl Default for CAMERA_FOV_STATUS_DATA {
8006 fn default() -> Self {
8007 Self::DEFAULT.clone()
8008 }
8009}
8010impl MessageData for CAMERA_FOV_STATUS_DATA {
8011 type Message = MavMessage;
8012 const ID: u32 = 271u32;
8013 const NAME: &'static str = "CAMERA_FOV_STATUS";
8014 const EXTRA_CRC: u8 = 22u8;
8015 const ENCODED_LEN: usize = 53usize;
8016 fn deser(
8017 _version: MavlinkVersion,
8018 __input: &[u8],
8019 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8020 let avail_len = __input.len();
8021 let mut payload_buf = [0; Self::ENCODED_LEN];
8022 let mut buf = if avail_len < Self::ENCODED_LEN {
8023 payload_buf[0..avail_len].copy_from_slice(__input);
8024 Bytes::new(&payload_buf)
8025 } else {
8026 Bytes::new(__input)
8027 };
8028 let mut __struct = Self::default();
8029 __struct.time_boot_ms = buf.get_u32_le()?;
8030 __struct.lat_camera = buf.get_i32_le()?;
8031 __struct.lon_camera = buf.get_i32_le()?;
8032 __struct.alt_camera = buf.get_i32_le()?;
8033 __struct.lat_image = buf.get_i32_le()?;
8034 __struct.lon_image = buf.get_i32_le()?;
8035 __struct.alt_image = buf.get_i32_le()?;
8036 for v in &mut __struct.q {
8037 let val = buf.get_f32_le()?;
8038 *v = val;
8039 }
8040 __struct.hfov = buf.get_f32_le()?;
8041 __struct.vfov = buf.get_f32_le()?;
8042 __struct.camera_device_id = buf.get_u8()?;
8043 Ok(__struct)
8044 }
8045 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8046 let mut __tmp = BytesMut::new(bytes);
8047 #[allow(clippy::absurd_extreme_comparisons)]
8048 #[allow(unused_comparisons)]
8049 if __tmp.remaining() < Self::ENCODED_LEN {
8050 panic!(
8051 "buffer is too small (need {} bytes, but got {})",
8052 Self::ENCODED_LEN,
8053 __tmp.remaining(),
8054 )
8055 }
8056 __tmp.put_u32_le(self.time_boot_ms);
8057 __tmp.put_i32_le(self.lat_camera);
8058 __tmp.put_i32_le(self.lon_camera);
8059 __tmp.put_i32_le(self.alt_camera);
8060 __tmp.put_i32_le(self.lat_image);
8061 __tmp.put_i32_le(self.lon_image);
8062 __tmp.put_i32_le(self.alt_image);
8063 for val in &self.q {
8064 __tmp.put_f32_le(*val);
8065 }
8066 __tmp.put_f32_le(self.hfov);
8067 __tmp.put_f32_le(self.vfov);
8068 if matches!(version, MavlinkVersion::V2) {
8069 __tmp.put_u8(self.camera_device_id);
8070 let len = __tmp.len();
8071 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8072 } else {
8073 __tmp.len()
8074 }
8075 }
8076}
8077#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
8078#[doc = ""]
8079#[doc = "ID: 263"]
8080#[derive(Debug, Clone, PartialEq)]
8081#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8082#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8083#[cfg_attr(feature = "ts", derive(TS))]
8084#[cfg_attr(feature = "ts", ts(export))]
8085pub struct CAMERA_IMAGE_CAPTURED_DATA {
8086 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
8087 pub time_utc: u64,
8088 #[doc = "Timestamp (time since system boot)."]
8089 pub time_boot_ms: u32,
8090 #[doc = "Latitude where image was taken"]
8091 pub lat: i32,
8092 #[doc = "Longitude where capture was taken"]
8093 pub lon: i32,
8094 #[doc = "Altitude (MSL) where image was taken"]
8095 pub alt: i32,
8096 #[doc = "Altitude above ground"]
8097 pub relative_alt: i32,
8098 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
8099 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8100 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8101 pub q: [f32; 4],
8102 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
8103 pub image_index: i32,
8104 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
8105 pub camera_id: u8,
8106 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
8107 pub capture_result: i8,
8108 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
8109 #[cfg_attr(feature = "ts", ts(type = "string"))]
8110 pub file_url: CharArray<205>,
8111}
8112impl CAMERA_IMAGE_CAPTURED_DATA {
8113 pub const ENCODED_LEN: usize = 255usize;
8114 pub const DEFAULT: Self = Self {
8115 time_utc: 0_u64,
8116 time_boot_ms: 0_u32,
8117 lat: 0_i32,
8118 lon: 0_i32,
8119 alt: 0_i32,
8120 relative_alt: 0_i32,
8121 q: [0.0_f32; 4usize],
8122 image_index: 0_i32,
8123 camera_id: 0_u8,
8124 capture_result: 0_i8,
8125 file_url: CharArray::new([0_u8; 205usize]),
8126 };
8127 #[cfg(feature = "arbitrary")]
8128 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8129 use arbitrary::{Arbitrary, Unstructured};
8130 let mut buf = [0u8; 1024];
8131 rng.fill_bytes(&mut buf);
8132 let mut unstructured = Unstructured::new(&buf);
8133 Self::arbitrary(&mut unstructured).unwrap_or_default()
8134 }
8135}
8136impl Default for CAMERA_IMAGE_CAPTURED_DATA {
8137 fn default() -> Self {
8138 Self::DEFAULT.clone()
8139 }
8140}
8141impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
8142 type Message = MavMessage;
8143 const ID: u32 = 263u32;
8144 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
8145 const EXTRA_CRC: u8 = 133u8;
8146 const ENCODED_LEN: usize = 255usize;
8147 fn deser(
8148 _version: MavlinkVersion,
8149 __input: &[u8],
8150 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8151 let avail_len = __input.len();
8152 let mut payload_buf = [0; Self::ENCODED_LEN];
8153 let mut buf = if avail_len < Self::ENCODED_LEN {
8154 payload_buf[0..avail_len].copy_from_slice(__input);
8155 Bytes::new(&payload_buf)
8156 } else {
8157 Bytes::new(__input)
8158 };
8159 let mut __struct = Self::default();
8160 __struct.time_utc = buf.get_u64_le()?;
8161 __struct.time_boot_ms = buf.get_u32_le()?;
8162 __struct.lat = buf.get_i32_le()?;
8163 __struct.lon = buf.get_i32_le()?;
8164 __struct.alt = buf.get_i32_le()?;
8165 __struct.relative_alt = buf.get_i32_le()?;
8166 for v in &mut __struct.q {
8167 let val = buf.get_f32_le()?;
8168 *v = val;
8169 }
8170 __struct.image_index = buf.get_i32_le()?;
8171 __struct.camera_id = buf.get_u8()?;
8172 __struct.capture_result = buf.get_i8()?;
8173 let mut tmp = [0_u8; 205usize];
8174 for v in &mut tmp {
8175 *v = buf.get_u8()?;
8176 }
8177 __struct.file_url = CharArray::new(tmp);
8178 Ok(__struct)
8179 }
8180 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8181 let mut __tmp = BytesMut::new(bytes);
8182 #[allow(clippy::absurd_extreme_comparisons)]
8183 #[allow(unused_comparisons)]
8184 if __tmp.remaining() < Self::ENCODED_LEN {
8185 panic!(
8186 "buffer is too small (need {} bytes, but got {})",
8187 Self::ENCODED_LEN,
8188 __tmp.remaining(),
8189 )
8190 }
8191 __tmp.put_u64_le(self.time_utc);
8192 __tmp.put_u32_le(self.time_boot_ms);
8193 __tmp.put_i32_le(self.lat);
8194 __tmp.put_i32_le(self.lon);
8195 __tmp.put_i32_le(self.alt);
8196 __tmp.put_i32_le(self.relative_alt);
8197 for val in &self.q {
8198 __tmp.put_f32_le(*val);
8199 }
8200 __tmp.put_i32_le(self.image_index);
8201 __tmp.put_u8(self.camera_id);
8202 __tmp.put_i8(self.capture_result);
8203 for val in &self.file_url {
8204 __tmp.put_u8(*val);
8205 }
8206 if matches!(version, MavlinkVersion::V2) {
8207 let len = __tmp.len();
8208 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8209 } else {
8210 __tmp.len()
8211 }
8212 }
8213}
8214#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
8215#[doc = ""]
8216#[doc = "ID: 259"]
8217#[derive(Debug, Clone, PartialEq)]
8218#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8219#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8220#[cfg_attr(feature = "ts", derive(TS))]
8221#[cfg_attr(feature = "ts", ts(export))]
8222pub struct CAMERA_INFORMATION_DATA {
8223 #[doc = "Timestamp (time since system boot)."]
8224 pub time_boot_ms: u32,
8225 #[doc = "Version of the camera firmware, encoded as: (Dev&0xff)<<24 | (Patch&0xff)<<16 | (Minor&0xff)<<8 | (Major&0xff). Use 0 if not known."]
8226 pub firmware_version: u32,
8227 #[doc = "Focal length. Use NaN if not known."]
8228 pub focal_length: f32,
8229 #[doc = "Image sensor size horizontal. Use NaN if not known."]
8230 pub sensor_size_h: f32,
8231 #[doc = "Image sensor size vertical. Use NaN if not known."]
8232 pub sensor_size_v: f32,
8233 #[doc = "Bitmap of camera capability flags."]
8234 pub flags: CameraCapFlags,
8235 #[doc = "Horizontal image resolution. Use 0 if not known."]
8236 pub resolution_h: u16,
8237 #[doc = "Vertical image resolution. Use 0 if not known."]
8238 pub resolution_v: u16,
8239 #[doc = "Camera definition version (iteration). Use 0 if not known."]
8240 pub cam_definition_version: u16,
8241 #[doc = "Name of the camera vendor"]
8242 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8243 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8244 pub vendor_name: [u8; 32],
8245 #[doc = "Name of the camera model"]
8246 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8247 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8248 pub model_name: [u8; 32],
8249 #[doc = "Reserved for a lens ID. Use 0 if not known."]
8250 pub lens_id: u8,
8251 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
8252 #[cfg_attr(feature = "ts", ts(type = "string"))]
8253 pub cam_definition_uri: CharArray<140>,
8254 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
8255 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8256 pub gimbal_device_id: u8,
8257 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8258 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8259 pub camera_device_id: u8,
8260}
8261impl CAMERA_INFORMATION_DATA {
8262 pub const ENCODED_LEN: usize = 237usize;
8263 pub const DEFAULT: Self = Self {
8264 time_boot_ms: 0_u32,
8265 firmware_version: 0_u32,
8266 focal_length: 0.0_f32,
8267 sensor_size_h: 0.0_f32,
8268 sensor_size_v: 0.0_f32,
8269 flags: CameraCapFlags::DEFAULT,
8270 resolution_h: 0_u16,
8271 resolution_v: 0_u16,
8272 cam_definition_version: 0_u16,
8273 vendor_name: [0_u8; 32usize],
8274 model_name: [0_u8; 32usize],
8275 lens_id: 0_u8,
8276 cam_definition_uri: CharArray::new([0_u8; 140usize]),
8277 gimbal_device_id: 0_u8,
8278 camera_device_id: 0_u8,
8279 };
8280 #[cfg(feature = "arbitrary")]
8281 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8282 use arbitrary::{Arbitrary, Unstructured};
8283 let mut buf = [0u8; 1024];
8284 rng.fill_bytes(&mut buf);
8285 let mut unstructured = Unstructured::new(&buf);
8286 Self::arbitrary(&mut unstructured).unwrap_or_default()
8287 }
8288}
8289impl Default for CAMERA_INFORMATION_DATA {
8290 fn default() -> Self {
8291 Self::DEFAULT.clone()
8292 }
8293}
8294impl MessageData for CAMERA_INFORMATION_DATA {
8295 type Message = MavMessage;
8296 const ID: u32 = 259u32;
8297 const NAME: &'static str = "CAMERA_INFORMATION";
8298 const EXTRA_CRC: u8 = 92u8;
8299 const ENCODED_LEN: usize = 237usize;
8300 fn deser(
8301 _version: MavlinkVersion,
8302 __input: &[u8],
8303 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8304 let avail_len = __input.len();
8305 let mut payload_buf = [0; Self::ENCODED_LEN];
8306 let mut buf = if avail_len < Self::ENCODED_LEN {
8307 payload_buf[0..avail_len].copy_from_slice(__input);
8308 Bytes::new(&payload_buf)
8309 } else {
8310 Bytes::new(__input)
8311 };
8312 let mut __struct = Self::default();
8313 __struct.time_boot_ms = buf.get_u32_le()?;
8314 __struct.firmware_version = buf.get_u32_le()?;
8315 __struct.focal_length = buf.get_f32_le()?;
8316 __struct.sensor_size_h = buf.get_f32_le()?;
8317 __struct.sensor_size_v = buf.get_f32_le()?;
8318 let tmp = buf.get_u32_le()?;
8319 __struct.flags = CameraCapFlags::from_bits(tmp as <CameraCapFlags as Flags>::Bits).ok_or(
8320 ::mavlink_core::error::ParserError::InvalidFlag {
8321 flag_type: "CameraCapFlags",
8322 value: tmp as u64,
8323 },
8324 )?;
8325 __struct.resolution_h = buf.get_u16_le()?;
8326 __struct.resolution_v = buf.get_u16_le()?;
8327 __struct.cam_definition_version = buf.get_u16_le()?;
8328 for v in &mut __struct.vendor_name {
8329 let val = buf.get_u8()?;
8330 *v = val;
8331 }
8332 for v in &mut __struct.model_name {
8333 let val = buf.get_u8()?;
8334 *v = val;
8335 }
8336 __struct.lens_id = buf.get_u8()?;
8337 let mut tmp = [0_u8; 140usize];
8338 for v in &mut tmp {
8339 *v = buf.get_u8()?;
8340 }
8341 __struct.cam_definition_uri = CharArray::new(tmp);
8342 __struct.gimbal_device_id = buf.get_u8()?;
8343 __struct.camera_device_id = buf.get_u8()?;
8344 Ok(__struct)
8345 }
8346 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8347 let mut __tmp = BytesMut::new(bytes);
8348 #[allow(clippy::absurd_extreme_comparisons)]
8349 #[allow(unused_comparisons)]
8350 if __tmp.remaining() < Self::ENCODED_LEN {
8351 panic!(
8352 "buffer is too small (need {} bytes, but got {})",
8353 Self::ENCODED_LEN,
8354 __tmp.remaining(),
8355 )
8356 }
8357 __tmp.put_u32_le(self.time_boot_ms);
8358 __tmp.put_u32_le(self.firmware_version);
8359 __tmp.put_f32_le(self.focal_length);
8360 __tmp.put_f32_le(self.sensor_size_h);
8361 __tmp.put_f32_le(self.sensor_size_v);
8362 __tmp.put_u32_le(self.flags.bits() as u32);
8363 __tmp.put_u16_le(self.resolution_h);
8364 __tmp.put_u16_le(self.resolution_v);
8365 __tmp.put_u16_le(self.cam_definition_version);
8366 for val in &self.vendor_name {
8367 __tmp.put_u8(*val);
8368 }
8369 for val in &self.model_name {
8370 __tmp.put_u8(*val);
8371 }
8372 __tmp.put_u8(self.lens_id);
8373 for val in &self.cam_definition_uri {
8374 __tmp.put_u8(*val);
8375 }
8376 if matches!(version, MavlinkVersion::V2) {
8377 __tmp.put_u8(self.gimbal_device_id);
8378 __tmp.put_u8(self.camera_device_id);
8379 let len = __tmp.len();
8380 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8381 } else {
8382 __tmp.len()
8383 }
8384 }
8385}
8386#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
8387#[doc = ""]
8388#[doc = "ID: 260"]
8389#[derive(Debug, Clone, PartialEq)]
8390#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8391#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8392#[cfg_attr(feature = "ts", derive(TS))]
8393#[cfg_attr(feature = "ts", ts(export))]
8394pub struct CAMERA_SETTINGS_DATA {
8395 #[doc = "Timestamp (time since system boot)."]
8396 pub time_boot_ms: u32,
8397 #[doc = "Camera mode"]
8398 pub mode_id: CameraMode,
8399 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
8400 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8401 pub zoomLevel: f32,
8402 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
8403 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8404 pub focusLevel: f32,
8405 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8406 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8407 pub camera_device_id: u8,
8408}
8409impl CAMERA_SETTINGS_DATA {
8410 pub const ENCODED_LEN: usize = 14usize;
8411 pub const DEFAULT: Self = Self {
8412 time_boot_ms: 0_u32,
8413 mode_id: CameraMode::DEFAULT,
8414 zoomLevel: 0.0_f32,
8415 focusLevel: 0.0_f32,
8416 camera_device_id: 0_u8,
8417 };
8418 #[cfg(feature = "arbitrary")]
8419 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8420 use arbitrary::{Arbitrary, Unstructured};
8421 let mut buf = [0u8; 1024];
8422 rng.fill_bytes(&mut buf);
8423 let mut unstructured = Unstructured::new(&buf);
8424 Self::arbitrary(&mut unstructured).unwrap_or_default()
8425 }
8426}
8427impl Default for CAMERA_SETTINGS_DATA {
8428 fn default() -> Self {
8429 Self::DEFAULT.clone()
8430 }
8431}
8432impl MessageData for CAMERA_SETTINGS_DATA {
8433 type Message = MavMessage;
8434 const ID: u32 = 260u32;
8435 const NAME: &'static str = "CAMERA_SETTINGS";
8436 const EXTRA_CRC: u8 = 146u8;
8437 const ENCODED_LEN: usize = 14usize;
8438 fn deser(
8439 _version: MavlinkVersion,
8440 __input: &[u8],
8441 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8442 let avail_len = __input.len();
8443 let mut payload_buf = [0; Self::ENCODED_LEN];
8444 let mut buf = if avail_len < Self::ENCODED_LEN {
8445 payload_buf[0..avail_len].copy_from_slice(__input);
8446 Bytes::new(&payload_buf)
8447 } else {
8448 Bytes::new(__input)
8449 };
8450 let mut __struct = Self::default();
8451 __struct.time_boot_ms = buf.get_u32_le()?;
8452 let tmp = buf.get_u8()?;
8453 __struct.mode_id =
8454 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8455 enum_type: "CameraMode",
8456 value: tmp as u64,
8457 })?;
8458 __struct.zoomLevel = buf.get_f32_le()?;
8459 __struct.focusLevel = buf.get_f32_le()?;
8460 __struct.camera_device_id = buf.get_u8()?;
8461 Ok(__struct)
8462 }
8463 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8464 let mut __tmp = BytesMut::new(bytes);
8465 #[allow(clippy::absurd_extreme_comparisons)]
8466 #[allow(unused_comparisons)]
8467 if __tmp.remaining() < Self::ENCODED_LEN {
8468 panic!(
8469 "buffer is too small (need {} bytes, but got {})",
8470 Self::ENCODED_LEN,
8471 __tmp.remaining(),
8472 )
8473 }
8474 __tmp.put_u32_le(self.time_boot_ms);
8475 __tmp.put_u8(self.mode_id as u8);
8476 if matches!(version, MavlinkVersion::V2) {
8477 __tmp.put_f32_le(self.zoomLevel);
8478 __tmp.put_f32_le(self.focusLevel);
8479 __tmp.put_u8(self.camera_device_id);
8480 let len = __tmp.len();
8481 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8482 } else {
8483 __tmp.len()
8484 }
8485 }
8486}
8487#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
8488#[doc = ""]
8489#[doc = "ID: 277"]
8490#[derive(Debug, Clone, PartialEq)]
8491#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8492#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8493#[cfg_attr(feature = "ts", derive(TS))]
8494#[cfg_attr(feature = "ts", ts(export))]
8495pub struct CAMERA_THERMAL_RANGE_DATA {
8496 #[doc = "Timestamp (time since system boot)."]
8497 pub time_boot_ms: u32,
8498 #[doc = "Temperature max."]
8499 pub max: f32,
8500 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
8501 pub max_point_x: f32,
8502 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
8503 pub max_point_y: f32,
8504 #[doc = "Temperature min."]
8505 pub min: f32,
8506 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
8507 pub min_point_x: f32,
8508 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
8509 pub min_point_y: f32,
8510 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
8511 pub stream_id: u8,
8512 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8513 pub camera_device_id: u8,
8514}
8515impl CAMERA_THERMAL_RANGE_DATA {
8516 pub const ENCODED_LEN: usize = 30usize;
8517 pub const DEFAULT: Self = Self {
8518 time_boot_ms: 0_u32,
8519 max: 0.0_f32,
8520 max_point_x: 0.0_f32,
8521 max_point_y: 0.0_f32,
8522 min: 0.0_f32,
8523 min_point_x: 0.0_f32,
8524 min_point_y: 0.0_f32,
8525 stream_id: 0_u8,
8526 camera_device_id: 0_u8,
8527 };
8528 #[cfg(feature = "arbitrary")]
8529 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8530 use arbitrary::{Arbitrary, Unstructured};
8531 let mut buf = [0u8; 1024];
8532 rng.fill_bytes(&mut buf);
8533 let mut unstructured = Unstructured::new(&buf);
8534 Self::arbitrary(&mut unstructured).unwrap_or_default()
8535 }
8536}
8537impl Default for CAMERA_THERMAL_RANGE_DATA {
8538 fn default() -> Self {
8539 Self::DEFAULT.clone()
8540 }
8541}
8542impl MessageData for CAMERA_THERMAL_RANGE_DATA {
8543 type Message = MavMessage;
8544 const ID: u32 = 277u32;
8545 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
8546 const EXTRA_CRC: u8 = 62u8;
8547 const ENCODED_LEN: usize = 30usize;
8548 fn deser(
8549 _version: MavlinkVersion,
8550 __input: &[u8],
8551 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8552 let avail_len = __input.len();
8553 let mut payload_buf = [0; Self::ENCODED_LEN];
8554 let mut buf = if avail_len < Self::ENCODED_LEN {
8555 payload_buf[0..avail_len].copy_from_slice(__input);
8556 Bytes::new(&payload_buf)
8557 } else {
8558 Bytes::new(__input)
8559 };
8560 let mut __struct = Self::default();
8561 __struct.time_boot_ms = buf.get_u32_le()?;
8562 __struct.max = buf.get_f32_le()?;
8563 __struct.max_point_x = buf.get_f32_le()?;
8564 __struct.max_point_y = buf.get_f32_le()?;
8565 __struct.min = buf.get_f32_le()?;
8566 __struct.min_point_x = buf.get_f32_le()?;
8567 __struct.min_point_y = buf.get_f32_le()?;
8568 __struct.stream_id = buf.get_u8()?;
8569 __struct.camera_device_id = buf.get_u8()?;
8570 Ok(__struct)
8571 }
8572 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8573 let mut __tmp = BytesMut::new(bytes);
8574 #[allow(clippy::absurd_extreme_comparisons)]
8575 #[allow(unused_comparisons)]
8576 if __tmp.remaining() < Self::ENCODED_LEN {
8577 panic!(
8578 "buffer is too small (need {} bytes, but got {})",
8579 Self::ENCODED_LEN,
8580 __tmp.remaining(),
8581 )
8582 }
8583 __tmp.put_u32_le(self.time_boot_ms);
8584 __tmp.put_f32_le(self.max);
8585 __tmp.put_f32_le(self.max_point_x);
8586 __tmp.put_f32_le(self.max_point_y);
8587 __tmp.put_f32_le(self.min);
8588 __tmp.put_f32_le(self.min_point_x);
8589 __tmp.put_f32_le(self.min_point_y);
8590 __tmp.put_u8(self.stream_id);
8591 __tmp.put_u8(self.camera_device_id);
8592 if matches!(version, MavlinkVersion::V2) {
8593 let len = __tmp.len();
8594 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8595 } else {
8596 __tmp.len()
8597 }
8598 }
8599}
8600#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
8601#[doc = ""]
8602#[doc = "ID: 276"]
8603#[derive(Debug, Clone, PartialEq)]
8604#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8605#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8606#[cfg_attr(feature = "ts", derive(TS))]
8607#[cfg_attr(feature = "ts", ts(export))]
8608pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
8609 #[doc = "Latitude of tracked object"]
8610 pub lat: i32,
8611 #[doc = "Longitude of tracked object"]
8612 pub lon: i32,
8613 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
8614 pub alt: f32,
8615 #[doc = "Horizontal accuracy. NAN if unknown"]
8616 pub h_acc: f32,
8617 #[doc = "Vertical accuracy. NAN if unknown"]
8618 pub v_acc: f32,
8619 #[doc = "North velocity of tracked object. NAN if unknown"]
8620 pub vel_n: f32,
8621 #[doc = "East velocity of tracked object. NAN if unknown"]
8622 pub vel_e: f32,
8623 #[doc = "Down velocity of tracked object. NAN if unknown"]
8624 pub vel_d: f32,
8625 #[doc = "Velocity accuracy. NAN if unknown"]
8626 pub vel_acc: f32,
8627 #[doc = "Distance between camera and tracked object. NAN if unknown"]
8628 pub dist: f32,
8629 #[doc = "Heading in radians, in NED. NAN if unknown"]
8630 pub hdg: f32,
8631 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
8632 pub hdg_acc: f32,
8633 #[doc = "Current tracking status"]
8634 pub tracking_status: CameraTrackingStatusFlags,
8635 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8636 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8637 pub camera_device_id: u8,
8638}
8639impl CAMERA_TRACKING_GEO_STATUS_DATA {
8640 pub const ENCODED_LEN: usize = 50usize;
8641 pub const DEFAULT: Self = Self {
8642 lat: 0_i32,
8643 lon: 0_i32,
8644 alt: 0.0_f32,
8645 h_acc: 0.0_f32,
8646 v_acc: 0.0_f32,
8647 vel_n: 0.0_f32,
8648 vel_e: 0.0_f32,
8649 vel_d: 0.0_f32,
8650 vel_acc: 0.0_f32,
8651 dist: 0.0_f32,
8652 hdg: 0.0_f32,
8653 hdg_acc: 0.0_f32,
8654 tracking_status: CameraTrackingStatusFlags::DEFAULT,
8655 camera_device_id: 0_u8,
8656 };
8657 #[cfg(feature = "arbitrary")]
8658 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8659 use arbitrary::{Arbitrary, Unstructured};
8660 let mut buf = [0u8; 1024];
8661 rng.fill_bytes(&mut buf);
8662 let mut unstructured = Unstructured::new(&buf);
8663 Self::arbitrary(&mut unstructured).unwrap_or_default()
8664 }
8665}
8666impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
8667 fn default() -> Self {
8668 Self::DEFAULT.clone()
8669 }
8670}
8671impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
8672 type Message = MavMessage;
8673 const ID: u32 = 276u32;
8674 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
8675 const EXTRA_CRC: u8 = 18u8;
8676 const ENCODED_LEN: usize = 50usize;
8677 fn deser(
8678 _version: MavlinkVersion,
8679 __input: &[u8],
8680 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8681 let avail_len = __input.len();
8682 let mut payload_buf = [0; Self::ENCODED_LEN];
8683 let mut buf = if avail_len < Self::ENCODED_LEN {
8684 payload_buf[0..avail_len].copy_from_slice(__input);
8685 Bytes::new(&payload_buf)
8686 } else {
8687 Bytes::new(__input)
8688 };
8689 let mut __struct = Self::default();
8690 __struct.lat = buf.get_i32_le()?;
8691 __struct.lon = buf.get_i32_le()?;
8692 __struct.alt = buf.get_f32_le()?;
8693 __struct.h_acc = buf.get_f32_le()?;
8694 __struct.v_acc = buf.get_f32_le()?;
8695 __struct.vel_n = buf.get_f32_le()?;
8696 __struct.vel_e = buf.get_f32_le()?;
8697 __struct.vel_d = buf.get_f32_le()?;
8698 __struct.vel_acc = buf.get_f32_le()?;
8699 __struct.dist = buf.get_f32_le()?;
8700 __struct.hdg = buf.get_f32_le()?;
8701 __struct.hdg_acc = buf.get_f32_le()?;
8702 let tmp = buf.get_u8()?;
8703 __struct.tracking_status =
8704 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8705 enum_type: "CameraTrackingStatusFlags",
8706 value: tmp as u64,
8707 })?;
8708 __struct.camera_device_id = buf.get_u8()?;
8709 Ok(__struct)
8710 }
8711 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8712 let mut __tmp = BytesMut::new(bytes);
8713 #[allow(clippy::absurd_extreme_comparisons)]
8714 #[allow(unused_comparisons)]
8715 if __tmp.remaining() < Self::ENCODED_LEN {
8716 panic!(
8717 "buffer is too small (need {} bytes, but got {})",
8718 Self::ENCODED_LEN,
8719 __tmp.remaining(),
8720 )
8721 }
8722 __tmp.put_i32_le(self.lat);
8723 __tmp.put_i32_le(self.lon);
8724 __tmp.put_f32_le(self.alt);
8725 __tmp.put_f32_le(self.h_acc);
8726 __tmp.put_f32_le(self.v_acc);
8727 __tmp.put_f32_le(self.vel_n);
8728 __tmp.put_f32_le(self.vel_e);
8729 __tmp.put_f32_le(self.vel_d);
8730 __tmp.put_f32_le(self.vel_acc);
8731 __tmp.put_f32_le(self.dist);
8732 __tmp.put_f32_le(self.hdg);
8733 __tmp.put_f32_le(self.hdg_acc);
8734 __tmp.put_u8(self.tracking_status as u8);
8735 if matches!(version, MavlinkVersion::V2) {
8736 __tmp.put_u8(self.camera_device_id);
8737 let len = __tmp.len();
8738 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8739 } else {
8740 __tmp.len()
8741 }
8742 }
8743}
8744#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
8745#[doc = ""]
8746#[doc = "ID: 275"]
8747#[derive(Debug, Clone, PartialEq)]
8748#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8749#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8750#[cfg_attr(feature = "ts", derive(TS))]
8751#[cfg_attr(feature = "ts", ts(export))]
8752pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
8753 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8754 pub point_x: f32,
8755 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8756 pub point_y: f32,
8757 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
8758 pub radius: f32,
8759 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8760 pub rec_top_x: f32,
8761 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8762 pub rec_top_y: f32,
8763 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8764 pub rec_bottom_x: f32,
8765 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8766 pub rec_bottom_y: f32,
8767 #[doc = "Current tracking status"]
8768 pub tracking_status: CameraTrackingStatusFlags,
8769 #[doc = "Current tracking mode"]
8770 pub tracking_mode: CameraTrackingMode,
8771 #[doc = "Defines location of target data"]
8772 pub target_data: CameraTrackingTargetData,
8773 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8774 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8775 pub camera_device_id: u8,
8776}
8777impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
8778 pub const ENCODED_LEN: usize = 32usize;
8779 pub const DEFAULT: Self = Self {
8780 point_x: 0.0_f32,
8781 point_y: 0.0_f32,
8782 radius: 0.0_f32,
8783 rec_top_x: 0.0_f32,
8784 rec_top_y: 0.0_f32,
8785 rec_bottom_x: 0.0_f32,
8786 rec_bottom_y: 0.0_f32,
8787 tracking_status: CameraTrackingStatusFlags::DEFAULT,
8788 tracking_mode: CameraTrackingMode::DEFAULT,
8789 target_data: CameraTrackingTargetData::DEFAULT,
8790 camera_device_id: 0_u8,
8791 };
8792 #[cfg(feature = "arbitrary")]
8793 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8794 use arbitrary::{Arbitrary, Unstructured};
8795 let mut buf = [0u8; 1024];
8796 rng.fill_bytes(&mut buf);
8797 let mut unstructured = Unstructured::new(&buf);
8798 Self::arbitrary(&mut unstructured).unwrap_or_default()
8799 }
8800}
8801impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8802 fn default() -> Self {
8803 Self::DEFAULT.clone()
8804 }
8805}
8806impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8807 type Message = MavMessage;
8808 const ID: u32 = 275u32;
8809 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
8810 const EXTRA_CRC: u8 = 126u8;
8811 const ENCODED_LEN: usize = 32usize;
8812 fn deser(
8813 _version: MavlinkVersion,
8814 __input: &[u8],
8815 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8816 let avail_len = __input.len();
8817 let mut payload_buf = [0; Self::ENCODED_LEN];
8818 let mut buf = if avail_len < Self::ENCODED_LEN {
8819 payload_buf[0..avail_len].copy_from_slice(__input);
8820 Bytes::new(&payload_buf)
8821 } else {
8822 Bytes::new(__input)
8823 };
8824 let mut __struct = Self::default();
8825 __struct.point_x = buf.get_f32_le()?;
8826 __struct.point_y = buf.get_f32_le()?;
8827 __struct.radius = buf.get_f32_le()?;
8828 __struct.rec_top_x = buf.get_f32_le()?;
8829 __struct.rec_top_y = buf.get_f32_le()?;
8830 __struct.rec_bottom_x = buf.get_f32_le()?;
8831 __struct.rec_bottom_y = buf.get_f32_le()?;
8832 let tmp = buf.get_u8()?;
8833 __struct.tracking_status =
8834 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8835 enum_type: "CameraTrackingStatusFlags",
8836 value: tmp as u64,
8837 })?;
8838 let tmp = buf.get_u8()?;
8839 __struct.tracking_mode =
8840 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8841 enum_type: "CameraTrackingMode",
8842 value: tmp as u64,
8843 })?;
8844 let tmp = buf.get_u8()?;
8845 __struct.target_data =
8846 CameraTrackingTargetData::from_bits(tmp as <CameraTrackingTargetData as Flags>::Bits)
8847 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
8848 flag_type: "CameraTrackingTargetData",
8849 value: tmp as u64,
8850 })?;
8851 __struct.camera_device_id = buf.get_u8()?;
8852 Ok(__struct)
8853 }
8854 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8855 let mut __tmp = BytesMut::new(bytes);
8856 #[allow(clippy::absurd_extreme_comparisons)]
8857 #[allow(unused_comparisons)]
8858 if __tmp.remaining() < Self::ENCODED_LEN {
8859 panic!(
8860 "buffer is too small (need {} bytes, but got {})",
8861 Self::ENCODED_LEN,
8862 __tmp.remaining(),
8863 )
8864 }
8865 __tmp.put_f32_le(self.point_x);
8866 __tmp.put_f32_le(self.point_y);
8867 __tmp.put_f32_le(self.radius);
8868 __tmp.put_f32_le(self.rec_top_x);
8869 __tmp.put_f32_le(self.rec_top_y);
8870 __tmp.put_f32_le(self.rec_bottom_x);
8871 __tmp.put_f32_le(self.rec_bottom_y);
8872 __tmp.put_u8(self.tracking_status as u8);
8873 __tmp.put_u8(self.tracking_mode as u8);
8874 __tmp.put_u8(self.target_data.bits() as u8);
8875 if matches!(version, MavlinkVersion::V2) {
8876 __tmp.put_u8(self.camera_device_id);
8877 let len = __tmp.len();
8878 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8879 } else {
8880 __tmp.len()
8881 }
8882 }
8883}
8884#[doc = "Camera-IMU triggering and synchronisation message."]
8885#[doc = ""]
8886#[doc = "ID: 112"]
8887#[derive(Debug, Clone, PartialEq)]
8888#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8889#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8890#[cfg_attr(feature = "ts", derive(TS))]
8891#[cfg_attr(feature = "ts", ts(export))]
8892pub struct CAMERA_TRIGGER_DATA {
8893 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
8894 pub time_usec: u64,
8895 #[doc = "Image frame sequence"]
8896 pub seq: u32,
8897}
8898impl CAMERA_TRIGGER_DATA {
8899 pub const ENCODED_LEN: usize = 12usize;
8900 pub const DEFAULT: Self = Self {
8901 time_usec: 0_u64,
8902 seq: 0_u32,
8903 };
8904 #[cfg(feature = "arbitrary")]
8905 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8906 use arbitrary::{Arbitrary, Unstructured};
8907 let mut buf = [0u8; 1024];
8908 rng.fill_bytes(&mut buf);
8909 let mut unstructured = Unstructured::new(&buf);
8910 Self::arbitrary(&mut unstructured).unwrap_or_default()
8911 }
8912}
8913impl Default for CAMERA_TRIGGER_DATA {
8914 fn default() -> Self {
8915 Self::DEFAULT.clone()
8916 }
8917}
8918impl MessageData for CAMERA_TRIGGER_DATA {
8919 type Message = MavMessage;
8920 const ID: u32 = 112u32;
8921 const NAME: &'static str = "CAMERA_TRIGGER";
8922 const EXTRA_CRC: u8 = 174u8;
8923 const ENCODED_LEN: usize = 12usize;
8924 fn deser(
8925 _version: MavlinkVersion,
8926 __input: &[u8],
8927 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8928 let avail_len = __input.len();
8929 let mut payload_buf = [0; Self::ENCODED_LEN];
8930 let mut buf = if avail_len < Self::ENCODED_LEN {
8931 payload_buf[0..avail_len].copy_from_slice(__input);
8932 Bytes::new(&payload_buf)
8933 } else {
8934 Bytes::new(__input)
8935 };
8936 let mut __struct = Self::default();
8937 __struct.time_usec = buf.get_u64_le()?;
8938 __struct.seq = buf.get_u32_le()?;
8939 Ok(__struct)
8940 }
8941 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8942 let mut __tmp = BytesMut::new(bytes);
8943 #[allow(clippy::absurd_extreme_comparisons)]
8944 #[allow(unused_comparisons)]
8945 if __tmp.remaining() < Self::ENCODED_LEN {
8946 panic!(
8947 "buffer is too small (need {} bytes, but got {})",
8948 Self::ENCODED_LEN,
8949 __tmp.remaining(),
8950 )
8951 }
8952 __tmp.put_u64_le(self.time_usec);
8953 __tmp.put_u32_le(self.seq);
8954 if matches!(version, MavlinkVersion::V2) {
8955 let len = __tmp.len();
8956 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8957 } else {
8958 __tmp.len()
8959 }
8960 }
8961}
8962#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
8963#[doc = ""]
8964#[doc = "ID: 387"]
8965#[derive(Debug, Clone, PartialEq)]
8966#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8967#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8968#[cfg_attr(feature = "ts", derive(TS))]
8969#[cfg_attr(feature = "ts", ts(export))]
8970pub struct CANFD_FRAME_DATA {
8971 #[doc = "Frame ID"]
8972 pub id: u32,
8973 #[doc = "System ID."]
8974 pub target_system: u8,
8975 #[doc = "Component ID."]
8976 pub target_component: u8,
8977 #[doc = "bus number"]
8978 pub bus: u8,
8979 #[doc = "Frame length"]
8980 pub len: u8,
8981 #[doc = "Frame data"]
8982 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8983 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
8984 pub data: [u8; 64],
8985}
8986impl CANFD_FRAME_DATA {
8987 pub const ENCODED_LEN: usize = 72usize;
8988 pub const DEFAULT: Self = Self {
8989 id: 0_u32,
8990 target_system: 0_u8,
8991 target_component: 0_u8,
8992 bus: 0_u8,
8993 len: 0_u8,
8994 data: [0_u8; 64usize],
8995 };
8996 #[cfg(feature = "arbitrary")]
8997 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8998 use arbitrary::{Arbitrary, Unstructured};
8999 let mut buf = [0u8; 1024];
9000 rng.fill_bytes(&mut buf);
9001 let mut unstructured = Unstructured::new(&buf);
9002 Self::arbitrary(&mut unstructured).unwrap_or_default()
9003 }
9004}
9005impl Default for CANFD_FRAME_DATA {
9006 fn default() -> Self {
9007 Self::DEFAULT.clone()
9008 }
9009}
9010impl MessageData for CANFD_FRAME_DATA {
9011 type Message = MavMessage;
9012 const ID: u32 = 387u32;
9013 const NAME: &'static str = "CANFD_FRAME";
9014 const EXTRA_CRC: u8 = 4u8;
9015 const ENCODED_LEN: usize = 72usize;
9016 fn deser(
9017 _version: MavlinkVersion,
9018 __input: &[u8],
9019 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9020 let avail_len = __input.len();
9021 let mut payload_buf = [0; Self::ENCODED_LEN];
9022 let mut buf = if avail_len < Self::ENCODED_LEN {
9023 payload_buf[0..avail_len].copy_from_slice(__input);
9024 Bytes::new(&payload_buf)
9025 } else {
9026 Bytes::new(__input)
9027 };
9028 let mut __struct = Self::default();
9029 __struct.id = buf.get_u32_le()?;
9030 __struct.target_system = buf.get_u8()?;
9031 __struct.target_component = buf.get_u8()?;
9032 __struct.bus = buf.get_u8()?;
9033 __struct.len = buf.get_u8()?;
9034 for v in &mut __struct.data {
9035 let val = buf.get_u8()?;
9036 *v = val;
9037 }
9038 Ok(__struct)
9039 }
9040 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9041 let mut __tmp = BytesMut::new(bytes);
9042 #[allow(clippy::absurd_extreme_comparisons)]
9043 #[allow(unused_comparisons)]
9044 if __tmp.remaining() < Self::ENCODED_LEN {
9045 panic!(
9046 "buffer is too small (need {} bytes, but got {})",
9047 Self::ENCODED_LEN,
9048 __tmp.remaining(),
9049 )
9050 }
9051 __tmp.put_u32_le(self.id);
9052 __tmp.put_u8(self.target_system);
9053 __tmp.put_u8(self.target_component);
9054 __tmp.put_u8(self.bus);
9055 __tmp.put_u8(self.len);
9056 for val in &self.data {
9057 __tmp.put_u8(*val);
9058 }
9059 if matches!(version, MavlinkVersion::V2) {
9060 let len = __tmp.len();
9061 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9062 } else {
9063 __tmp.len()
9064 }
9065 }
9066}
9067#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
9068#[doc = ""]
9069#[doc = "ID: 388"]
9070#[derive(Debug, Clone, PartialEq)]
9071#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9072#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9073#[cfg_attr(feature = "ts", derive(TS))]
9074#[cfg_attr(feature = "ts", ts(export))]
9075pub struct CAN_FILTER_MODIFY_DATA {
9076 #[doc = "filter IDs, length num_ids"]
9077 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9078 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9079 pub ids: [u16; 16],
9080 #[doc = "System ID."]
9081 pub target_system: u8,
9082 #[doc = "Component ID."]
9083 pub target_component: u8,
9084 #[doc = "bus number"]
9085 pub bus: u8,
9086 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
9087 pub operation: CanFilterOp,
9088 #[doc = "number of IDs in filter list"]
9089 pub num_ids: u8,
9090}
9091impl CAN_FILTER_MODIFY_DATA {
9092 pub const ENCODED_LEN: usize = 37usize;
9093 pub const DEFAULT: Self = Self {
9094 ids: [0_u16; 16usize],
9095 target_system: 0_u8,
9096 target_component: 0_u8,
9097 bus: 0_u8,
9098 operation: CanFilterOp::DEFAULT,
9099 num_ids: 0_u8,
9100 };
9101 #[cfg(feature = "arbitrary")]
9102 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9103 use arbitrary::{Arbitrary, Unstructured};
9104 let mut buf = [0u8; 1024];
9105 rng.fill_bytes(&mut buf);
9106 let mut unstructured = Unstructured::new(&buf);
9107 Self::arbitrary(&mut unstructured).unwrap_or_default()
9108 }
9109}
9110impl Default for CAN_FILTER_MODIFY_DATA {
9111 fn default() -> Self {
9112 Self::DEFAULT.clone()
9113 }
9114}
9115impl MessageData for CAN_FILTER_MODIFY_DATA {
9116 type Message = MavMessage;
9117 const ID: u32 = 388u32;
9118 const NAME: &'static str = "CAN_FILTER_MODIFY";
9119 const EXTRA_CRC: u8 = 8u8;
9120 const ENCODED_LEN: usize = 37usize;
9121 fn deser(
9122 _version: MavlinkVersion,
9123 __input: &[u8],
9124 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9125 let avail_len = __input.len();
9126 let mut payload_buf = [0; Self::ENCODED_LEN];
9127 let mut buf = if avail_len < Self::ENCODED_LEN {
9128 payload_buf[0..avail_len].copy_from_slice(__input);
9129 Bytes::new(&payload_buf)
9130 } else {
9131 Bytes::new(__input)
9132 };
9133 let mut __struct = Self::default();
9134 for v in &mut __struct.ids {
9135 let val = buf.get_u16_le()?;
9136 *v = val;
9137 }
9138 __struct.target_system = buf.get_u8()?;
9139 __struct.target_component = buf.get_u8()?;
9140 __struct.bus = buf.get_u8()?;
9141 let tmp = buf.get_u8()?;
9142 __struct.operation =
9143 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9144 enum_type: "CanFilterOp",
9145 value: tmp as u64,
9146 })?;
9147 __struct.num_ids = buf.get_u8()?;
9148 Ok(__struct)
9149 }
9150 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9151 let mut __tmp = BytesMut::new(bytes);
9152 #[allow(clippy::absurd_extreme_comparisons)]
9153 #[allow(unused_comparisons)]
9154 if __tmp.remaining() < Self::ENCODED_LEN {
9155 panic!(
9156 "buffer is too small (need {} bytes, but got {})",
9157 Self::ENCODED_LEN,
9158 __tmp.remaining(),
9159 )
9160 }
9161 for val in &self.ids {
9162 __tmp.put_u16_le(*val);
9163 }
9164 __tmp.put_u8(self.target_system);
9165 __tmp.put_u8(self.target_component);
9166 __tmp.put_u8(self.bus);
9167 __tmp.put_u8(self.operation as u8);
9168 __tmp.put_u8(self.num_ids);
9169 if matches!(version, MavlinkVersion::V2) {
9170 let len = __tmp.len();
9171 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9172 } else {
9173 __tmp.len()
9174 }
9175 }
9176}
9177#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
9178#[doc = ""]
9179#[doc = "ID: 386"]
9180#[derive(Debug, Clone, PartialEq)]
9181#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9182#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9183#[cfg_attr(feature = "ts", derive(TS))]
9184#[cfg_attr(feature = "ts", ts(export))]
9185pub struct CAN_FRAME_DATA {
9186 #[doc = "Frame ID"]
9187 pub id: u32,
9188 #[doc = "System ID."]
9189 pub target_system: u8,
9190 #[doc = "Component ID."]
9191 pub target_component: u8,
9192 #[doc = "Bus number"]
9193 pub bus: u8,
9194 #[doc = "Frame length"]
9195 pub len: u8,
9196 #[doc = "Frame data"]
9197 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9198 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
9199 pub data: [u8; 8],
9200}
9201impl CAN_FRAME_DATA {
9202 pub const ENCODED_LEN: usize = 16usize;
9203 pub const DEFAULT: Self = Self {
9204 id: 0_u32,
9205 target_system: 0_u8,
9206 target_component: 0_u8,
9207 bus: 0_u8,
9208 len: 0_u8,
9209 data: [0_u8; 8usize],
9210 };
9211 #[cfg(feature = "arbitrary")]
9212 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9213 use arbitrary::{Arbitrary, Unstructured};
9214 let mut buf = [0u8; 1024];
9215 rng.fill_bytes(&mut buf);
9216 let mut unstructured = Unstructured::new(&buf);
9217 Self::arbitrary(&mut unstructured).unwrap_or_default()
9218 }
9219}
9220impl Default for CAN_FRAME_DATA {
9221 fn default() -> Self {
9222 Self::DEFAULT.clone()
9223 }
9224}
9225impl MessageData for CAN_FRAME_DATA {
9226 type Message = MavMessage;
9227 const ID: u32 = 386u32;
9228 const NAME: &'static str = "CAN_FRAME";
9229 const EXTRA_CRC: u8 = 132u8;
9230 const ENCODED_LEN: usize = 16usize;
9231 fn deser(
9232 _version: MavlinkVersion,
9233 __input: &[u8],
9234 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9235 let avail_len = __input.len();
9236 let mut payload_buf = [0; Self::ENCODED_LEN];
9237 let mut buf = if avail_len < Self::ENCODED_LEN {
9238 payload_buf[0..avail_len].copy_from_slice(__input);
9239 Bytes::new(&payload_buf)
9240 } else {
9241 Bytes::new(__input)
9242 };
9243 let mut __struct = Self::default();
9244 __struct.id = buf.get_u32_le()?;
9245 __struct.target_system = buf.get_u8()?;
9246 __struct.target_component = buf.get_u8()?;
9247 __struct.bus = buf.get_u8()?;
9248 __struct.len = buf.get_u8()?;
9249 for v in &mut __struct.data {
9250 let val = buf.get_u8()?;
9251 *v = val;
9252 }
9253 Ok(__struct)
9254 }
9255 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9256 let mut __tmp = BytesMut::new(bytes);
9257 #[allow(clippy::absurd_extreme_comparisons)]
9258 #[allow(unused_comparisons)]
9259 if __tmp.remaining() < Self::ENCODED_LEN {
9260 panic!(
9261 "buffer is too small (need {} bytes, but got {})",
9262 Self::ENCODED_LEN,
9263 __tmp.remaining(),
9264 )
9265 }
9266 __tmp.put_u32_le(self.id);
9267 __tmp.put_u8(self.target_system);
9268 __tmp.put_u8(self.target_component);
9269 __tmp.put_u8(self.bus);
9270 __tmp.put_u8(self.len);
9271 for val in &self.data {
9272 __tmp.put_u8(*val);
9273 }
9274 if matches!(version, MavlinkVersion::V2) {
9275 let len = __tmp.len();
9276 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9277 } else {
9278 __tmp.len()
9279 }
9280 }
9281}
9282#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
9283#[doc = ""]
9284#[doc = "ID: 336"]
9285#[derive(Debug, Clone, PartialEq)]
9286#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9287#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9288#[cfg_attr(feature = "ts", derive(TS))]
9289#[cfg_attr(feature = "ts", ts(export))]
9290pub struct CELLULAR_CONFIG_DATA {
9291 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
9292 pub enable_lte: u8,
9293 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
9294 pub enable_pin: u8,
9295 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
9296 #[cfg_attr(feature = "ts", ts(type = "string"))]
9297 pub pin: CharArray<16>,
9298 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
9299 #[cfg_attr(feature = "ts", ts(type = "string"))]
9300 pub new_pin: CharArray<16>,
9301 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
9302 #[cfg_attr(feature = "ts", ts(type = "string"))]
9303 pub apn: CharArray<32>,
9304 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
9305 #[cfg_attr(feature = "ts", ts(type = "string"))]
9306 pub puk: CharArray<16>,
9307 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
9308 pub roaming: u8,
9309 #[doc = "Message acceptance response (sent back to GS)."]
9310 pub response: CellularConfigResponse,
9311}
9312impl CELLULAR_CONFIG_DATA {
9313 pub const ENCODED_LEN: usize = 84usize;
9314 pub const DEFAULT: Self = Self {
9315 enable_lte: 0_u8,
9316 enable_pin: 0_u8,
9317 pin: CharArray::new([0_u8; 16usize]),
9318 new_pin: CharArray::new([0_u8; 16usize]),
9319 apn: CharArray::new([0_u8; 32usize]),
9320 puk: CharArray::new([0_u8; 16usize]),
9321 roaming: 0_u8,
9322 response: CellularConfigResponse::DEFAULT,
9323 };
9324 #[cfg(feature = "arbitrary")]
9325 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9326 use arbitrary::{Arbitrary, Unstructured};
9327 let mut buf = [0u8; 1024];
9328 rng.fill_bytes(&mut buf);
9329 let mut unstructured = Unstructured::new(&buf);
9330 Self::arbitrary(&mut unstructured).unwrap_or_default()
9331 }
9332}
9333impl Default for CELLULAR_CONFIG_DATA {
9334 fn default() -> Self {
9335 Self::DEFAULT.clone()
9336 }
9337}
9338impl MessageData for CELLULAR_CONFIG_DATA {
9339 type Message = MavMessage;
9340 const ID: u32 = 336u32;
9341 const NAME: &'static str = "CELLULAR_CONFIG";
9342 const EXTRA_CRC: u8 = 245u8;
9343 const ENCODED_LEN: usize = 84usize;
9344 fn deser(
9345 _version: MavlinkVersion,
9346 __input: &[u8],
9347 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9348 let avail_len = __input.len();
9349 let mut payload_buf = [0; Self::ENCODED_LEN];
9350 let mut buf = if avail_len < Self::ENCODED_LEN {
9351 payload_buf[0..avail_len].copy_from_slice(__input);
9352 Bytes::new(&payload_buf)
9353 } else {
9354 Bytes::new(__input)
9355 };
9356 let mut __struct = Self::default();
9357 __struct.enable_lte = buf.get_u8()?;
9358 __struct.enable_pin = buf.get_u8()?;
9359 let mut tmp = [0_u8; 16usize];
9360 for v in &mut tmp {
9361 *v = buf.get_u8()?;
9362 }
9363 __struct.pin = CharArray::new(tmp);
9364 let mut tmp = [0_u8; 16usize];
9365 for v in &mut tmp {
9366 *v = buf.get_u8()?;
9367 }
9368 __struct.new_pin = CharArray::new(tmp);
9369 let mut tmp = [0_u8; 32usize];
9370 for v in &mut tmp {
9371 *v = buf.get_u8()?;
9372 }
9373 __struct.apn = CharArray::new(tmp);
9374 let mut tmp = [0_u8; 16usize];
9375 for v in &mut tmp {
9376 *v = buf.get_u8()?;
9377 }
9378 __struct.puk = CharArray::new(tmp);
9379 __struct.roaming = buf.get_u8()?;
9380 let tmp = buf.get_u8()?;
9381 __struct.response =
9382 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9383 enum_type: "CellularConfigResponse",
9384 value: tmp as u64,
9385 })?;
9386 Ok(__struct)
9387 }
9388 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9389 let mut __tmp = BytesMut::new(bytes);
9390 #[allow(clippy::absurd_extreme_comparisons)]
9391 #[allow(unused_comparisons)]
9392 if __tmp.remaining() < Self::ENCODED_LEN {
9393 panic!(
9394 "buffer is too small (need {} bytes, but got {})",
9395 Self::ENCODED_LEN,
9396 __tmp.remaining(),
9397 )
9398 }
9399 __tmp.put_u8(self.enable_lte);
9400 __tmp.put_u8(self.enable_pin);
9401 for val in &self.pin {
9402 __tmp.put_u8(*val);
9403 }
9404 for val in &self.new_pin {
9405 __tmp.put_u8(*val);
9406 }
9407 for val in &self.apn {
9408 __tmp.put_u8(*val);
9409 }
9410 for val in &self.puk {
9411 __tmp.put_u8(*val);
9412 }
9413 __tmp.put_u8(self.roaming);
9414 __tmp.put_u8(self.response as u8);
9415 if matches!(version, MavlinkVersion::V2) {
9416 let len = __tmp.len();
9417 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9418 } else {
9419 __tmp.len()
9420 }
9421 }
9422}
9423#[doc = "Report current used cellular network status."]
9424#[doc = ""]
9425#[doc = "ID: 334"]
9426#[derive(Debug, Clone, PartialEq)]
9427#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9428#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9429#[cfg_attr(feature = "ts", derive(TS))]
9430#[cfg_attr(feature = "ts", ts(export))]
9431pub struct CELLULAR_STATUS_DATA {
9432 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
9433 pub mcc: u16,
9434 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
9435 pub mnc: u16,
9436 #[doc = "Location area code. If unknown, set to 0"]
9437 pub lac: u16,
9438 #[doc = "Cellular modem status"]
9439 pub status: CellularStatusFlag,
9440 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
9441 pub failure_reason: CellularNetworkFailedReason,
9442 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
9443 pub mavtype: CellularNetworkRadioType,
9444 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
9445 pub quality: u8,
9446}
9447impl CELLULAR_STATUS_DATA {
9448 pub const ENCODED_LEN: usize = 10usize;
9449 pub const DEFAULT: Self = Self {
9450 mcc: 0_u16,
9451 mnc: 0_u16,
9452 lac: 0_u16,
9453 status: CellularStatusFlag::DEFAULT,
9454 failure_reason: CellularNetworkFailedReason::DEFAULT,
9455 mavtype: CellularNetworkRadioType::DEFAULT,
9456 quality: 0_u8,
9457 };
9458 #[cfg(feature = "arbitrary")]
9459 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9460 use arbitrary::{Arbitrary, Unstructured};
9461 let mut buf = [0u8; 1024];
9462 rng.fill_bytes(&mut buf);
9463 let mut unstructured = Unstructured::new(&buf);
9464 Self::arbitrary(&mut unstructured).unwrap_or_default()
9465 }
9466}
9467impl Default for CELLULAR_STATUS_DATA {
9468 fn default() -> Self {
9469 Self::DEFAULT.clone()
9470 }
9471}
9472impl MessageData for CELLULAR_STATUS_DATA {
9473 type Message = MavMessage;
9474 const ID: u32 = 334u32;
9475 const NAME: &'static str = "CELLULAR_STATUS";
9476 const EXTRA_CRC: u8 = 72u8;
9477 const ENCODED_LEN: usize = 10usize;
9478 fn deser(
9479 _version: MavlinkVersion,
9480 __input: &[u8],
9481 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9482 let avail_len = __input.len();
9483 let mut payload_buf = [0; Self::ENCODED_LEN];
9484 let mut buf = if avail_len < Self::ENCODED_LEN {
9485 payload_buf[0..avail_len].copy_from_slice(__input);
9486 Bytes::new(&payload_buf)
9487 } else {
9488 Bytes::new(__input)
9489 };
9490 let mut __struct = Self::default();
9491 __struct.mcc = buf.get_u16_le()?;
9492 __struct.mnc = buf.get_u16_le()?;
9493 __struct.lac = buf.get_u16_le()?;
9494 let tmp = buf.get_u8()?;
9495 __struct.status =
9496 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9497 enum_type: "CellularStatusFlag",
9498 value: tmp as u64,
9499 })?;
9500 let tmp = buf.get_u8()?;
9501 __struct.failure_reason =
9502 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9503 enum_type: "CellularNetworkFailedReason",
9504 value: tmp as u64,
9505 })?;
9506 let tmp = buf.get_u8()?;
9507 __struct.mavtype =
9508 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9509 enum_type: "CellularNetworkRadioType",
9510 value: tmp as u64,
9511 })?;
9512 __struct.quality = buf.get_u8()?;
9513 Ok(__struct)
9514 }
9515 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9516 let mut __tmp = BytesMut::new(bytes);
9517 #[allow(clippy::absurd_extreme_comparisons)]
9518 #[allow(unused_comparisons)]
9519 if __tmp.remaining() < Self::ENCODED_LEN {
9520 panic!(
9521 "buffer is too small (need {} bytes, but got {})",
9522 Self::ENCODED_LEN,
9523 __tmp.remaining(),
9524 )
9525 }
9526 __tmp.put_u16_le(self.mcc);
9527 __tmp.put_u16_le(self.mnc);
9528 __tmp.put_u16_le(self.lac);
9529 __tmp.put_u8(self.status as u8);
9530 __tmp.put_u8(self.failure_reason as u8);
9531 __tmp.put_u8(self.mavtype as u8);
9532 __tmp.put_u8(self.quality);
9533 if matches!(version, MavlinkVersion::V2) {
9534 let len = __tmp.len();
9535 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9536 } else {
9537 __tmp.len()
9538 }
9539 }
9540}
9541#[doc = "Request to control this MAV."]
9542#[doc = ""]
9543#[doc = "ID: 5"]
9544#[derive(Debug, Clone, PartialEq)]
9545#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9546#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9547#[cfg_attr(feature = "ts", derive(TS))]
9548#[cfg_attr(feature = "ts", ts(export))]
9549pub struct CHANGE_OPERATOR_CONTROL_DATA {
9550 #[doc = "System the GCS requests control for"]
9551 pub target_system: u8,
9552 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
9553 pub control_request: u8,
9554 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
9555 pub version: u8,
9556 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
9557 #[cfg_attr(feature = "ts", ts(type = "string"))]
9558 pub passkey: CharArray<25>,
9559}
9560impl CHANGE_OPERATOR_CONTROL_DATA {
9561 pub const ENCODED_LEN: usize = 28usize;
9562 pub const DEFAULT: Self = Self {
9563 target_system: 0_u8,
9564 control_request: 0_u8,
9565 version: 0_u8,
9566 passkey: CharArray::new([0_u8; 25usize]),
9567 };
9568 #[cfg(feature = "arbitrary")]
9569 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9570 use arbitrary::{Arbitrary, Unstructured};
9571 let mut buf = [0u8; 1024];
9572 rng.fill_bytes(&mut buf);
9573 let mut unstructured = Unstructured::new(&buf);
9574 Self::arbitrary(&mut unstructured).unwrap_or_default()
9575 }
9576}
9577impl Default for CHANGE_OPERATOR_CONTROL_DATA {
9578 fn default() -> Self {
9579 Self::DEFAULT.clone()
9580 }
9581}
9582impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
9583 type Message = MavMessage;
9584 const ID: u32 = 5u32;
9585 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
9586 const EXTRA_CRC: u8 = 217u8;
9587 const ENCODED_LEN: usize = 28usize;
9588 fn deser(
9589 _version: MavlinkVersion,
9590 __input: &[u8],
9591 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9592 let avail_len = __input.len();
9593 let mut payload_buf = [0; Self::ENCODED_LEN];
9594 let mut buf = if avail_len < Self::ENCODED_LEN {
9595 payload_buf[0..avail_len].copy_from_slice(__input);
9596 Bytes::new(&payload_buf)
9597 } else {
9598 Bytes::new(__input)
9599 };
9600 let mut __struct = Self::default();
9601 __struct.target_system = buf.get_u8()?;
9602 __struct.control_request = buf.get_u8()?;
9603 __struct.version = buf.get_u8()?;
9604 let mut tmp = [0_u8; 25usize];
9605 for v in &mut tmp {
9606 *v = buf.get_u8()?;
9607 }
9608 __struct.passkey = CharArray::new(tmp);
9609 Ok(__struct)
9610 }
9611 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9612 let mut __tmp = BytesMut::new(bytes);
9613 #[allow(clippy::absurd_extreme_comparisons)]
9614 #[allow(unused_comparisons)]
9615 if __tmp.remaining() < Self::ENCODED_LEN {
9616 panic!(
9617 "buffer is too small (need {} bytes, but got {})",
9618 Self::ENCODED_LEN,
9619 __tmp.remaining(),
9620 )
9621 }
9622 __tmp.put_u8(self.target_system);
9623 __tmp.put_u8(self.control_request);
9624 __tmp.put_u8(self.version);
9625 for val in &self.passkey {
9626 __tmp.put_u8(*val);
9627 }
9628 if matches!(version, MavlinkVersion::V2) {
9629 let len = __tmp.len();
9630 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9631 } else {
9632 __tmp.len()
9633 }
9634 }
9635}
9636#[doc = "Accept / deny control of this MAV."]
9637#[doc = ""]
9638#[doc = "ID: 6"]
9639#[derive(Debug, Clone, PartialEq)]
9640#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9641#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9642#[cfg_attr(feature = "ts", derive(TS))]
9643#[cfg_attr(feature = "ts", ts(export))]
9644pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
9645 #[doc = "ID of the GCS this message"]
9646 pub gcs_system_id: u8,
9647 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
9648 pub control_request: u8,
9649 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
9650 pub ack: u8,
9651}
9652impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
9653 pub const ENCODED_LEN: usize = 3usize;
9654 pub const DEFAULT: Self = Self {
9655 gcs_system_id: 0_u8,
9656 control_request: 0_u8,
9657 ack: 0_u8,
9658 };
9659 #[cfg(feature = "arbitrary")]
9660 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9661 use arbitrary::{Arbitrary, Unstructured};
9662 let mut buf = [0u8; 1024];
9663 rng.fill_bytes(&mut buf);
9664 let mut unstructured = Unstructured::new(&buf);
9665 Self::arbitrary(&mut unstructured).unwrap_or_default()
9666 }
9667}
9668impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
9669 fn default() -> Self {
9670 Self::DEFAULT.clone()
9671 }
9672}
9673impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
9674 type Message = MavMessage;
9675 const ID: u32 = 6u32;
9676 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
9677 const EXTRA_CRC: u8 = 104u8;
9678 const ENCODED_LEN: usize = 3usize;
9679 fn deser(
9680 _version: MavlinkVersion,
9681 __input: &[u8],
9682 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9683 let avail_len = __input.len();
9684 let mut payload_buf = [0; Self::ENCODED_LEN];
9685 let mut buf = if avail_len < Self::ENCODED_LEN {
9686 payload_buf[0..avail_len].copy_from_slice(__input);
9687 Bytes::new(&payload_buf)
9688 } else {
9689 Bytes::new(__input)
9690 };
9691 let mut __struct = Self::default();
9692 __struct.gcs_system_id = buf.get_u8()?;
9693 __struct.control_request = buf.get_u8()?;
9694 __struct.ack = buf.get_u8()?;
9695 Ok(__struct)
9696 }
9697 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9698 let mut __tmp = BytesMut::new(bytes);
9699 #[allow(clippy::absurd_extreme_comparisons)]
9700 #[allow(unused_comparisons)]
9701 if __tmp.remaining() < Self::ENCODED_LEN {
9702 panic!(
9703 "buffer is too small (need {} bytes, but got {})",
9704 Self::ENCODED_LEN,
9705 __tmp.remaining(),
9706 )
9707 }
9708 __tmp.put_u8(self.gcs_system_id);
9709 __tmp.put_u8(self.control_request);
9710 __tmp.put_u8(self.ack);
9711 if matches!(version, MavlinkVersion::V2) {
9712 let len = __tmp.len();
9713 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9714 } else {
9715 __tmp.len()
9716 }
9717 }
9718}
9719#[doc = "Information about a potential collision."]
9720#[doc = ""]
9721#[doc = "ID: 247"]
9722#[derive(Debug, Clone, PartialEq)]
9723#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9724#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9725#[cfg_attr(feature = "ts", derive(TS))]
9726#[cfg_attr(feature = "ts", ts(export))]
9727pub struct COLLISION_DATA {
9728 #[doc = "Unique identifier, domain based on src field"]
9729 pub id: u32,
9730 #[doc = "Estimated time until collision occurs"]
9731 pub time_to_minimum_delta: f32,
9732 #[doc = "Closest vertical distance between vehicle and object"]
9733 pub altitude_minimum_delta: f32,
9734 #[doc = "Closest horizontal distance between vehicle and object"]
9735 pub horizontal_minimum_delta: f32,
9736 #[doc = "Collision data source"]
9737 pub src: MavCollisionSrc,
9738 #[doc = "Action that is being taken to avoid this collision"]
9739 pub action: MavCollisionAction,
9740 #[doc = "How concerned the aircraft is about this collision"]
9741 pub threat_level: MavCollisionThreatLevel,
9742}
9743impl COLLISION_DATA {
9744 pub const ENCODED_LEN: usize = 19usize;
9745 pub const DEFAULT: Self = Self {
9746 id: 0_u32,
9747 time_to_minimum_delta: 0.0_f32,
9748 altitude_minimum_delta: 0.0_f32,
9749 horizontal_minimum_delta: 0.0_f32,
9750 src: MavCollisionSrc::DEFAULT,
9751 action: MavCollisionAction::DEFAULT,
9752 threat_level: MavCollisionThreatLevel::DEFAULT,
9753 };
9754 #[cfg(feature = "arbitrary")]
9755 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9756 use arbitrary::{Arbitrary, Unstructured};
9757 let mut buf = [0u8; 1024];
9758 rng.fill_bytes(&mut buf);
9759 let mut unstructured = Unstructured::new(&buf);
9760 Self::arbitrary(&mut unstructured).unwrap_or_default()
9761 }
9762}
9763impl Default for COLLISION_DATA {
9764 fn default() -> Self {
9765 Self::DEFAULT.clone()
9766 }
9767}
9768impl MessageData for COLLISION_DATA {
9769 type Message = MavMessage;
9770 const ID: u32 = 247u32;
9771 const NAME: &'static str = "COLLISION";
9772 const EXTRA_CRC: u8 = 81u8;
9773 const ENCODED_LEN: usize = 19usize;
9774 fn deser(
9775 _version: MavlinkVersion,
9776 __input: &[u8],
9777 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9778 let avail_len = __input.len();
9779 let mut payload_buf = [0; Self::ENCODED_LEN];
9780 let mut buf = if avail_len < Self::ENCODED_LEN {
9781 payload_buf[0..avail_len].copy_from_slice(__input);
9782 Bytes::new(&payload_buf)
9783 } else {
9784 Bytes::new(__input)
9785 };
9786 let mut __struct = Self::default();
9787 __struct.id = buf.get_u32_le()?;
9788 __struct.time_to_minimum_delta = buf.get_f32_le()?;
9789 __struct.altitude_minimum_delta = buf.get_f32_le()?;
9790 __struct.horizontal_minimum_delta = buf.get_f32_le()?;
9791 let tmp = buf.get_u8()?;
9792 __struct.src =
9793 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9794 enum_type: "MavCollisionSrc",
9795 value: tmp as u64,
9796 })?;
9797 let tmp = buf.get_u8()?;
9798 __struct.action =
9799 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9800 enum_type: "MavCollisionAction",
9801 value: tmp as u64,
9802 })?;
9803 let tmp = buf.get_u8()?;
9804 __struct.threat_level =
9805 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9806 enum_type: "MavCollisionThreatLevel",
9807 value: tmp as u64,
9808 })?;
9809 Ok(__struct)
9810 }
9811 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9812 let mut __tmp = BytesMut::new(bytes);
9813 #[allow(clippy::absurd_extreme_comparisons)]
9814 #[allow(unused_comparisons)]
9815 if __tmp.remaining() < Self::ENCODED_LEN {
9816 panic!(
9817 "buffer is too small (need {} bytes, but got {})",
9818 Self::ENCODED_LEN,
9819 __tmp.remaining(),
9820 )
9821 }
9822 __tmp.put_u32_le(self.id);
9823 __tmp.put_f32_le(self.time_to_minimum_delta);
9824 __tmp.put_f32_le(self.altitude_minimum_delta);
9825 __tmp.put_f32_le(self.horizontal_minimum_delta);
9826 __tmp.put_u8(self.src as u8);
9827 __tmp.put_u8(self.action as u8);
9828 __tmp.put_u8(self.threat_level as u8);
9829 if matches!(version, MavlinkVersion::V2) {
9830 let len = __tmp.len();
9831 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9832 } else {
9833 __tmp.len()
9834 }
9835 }
9836}
9837#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9838#[doc = ""]
9839#[doc = "ID: 77"]
9840#[derive(Debug, Clone, PartialEq)]
9841#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9842#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9843#[cfg_attr(feature = "ts", derive(TS))]
9844#[cfg_attr(feature = "ts", ts(export))]
9845pub struct COMMAND_ACK_DATA {
9846 #[doc = "Command ID (of acknowledged command)."]
9847 pub command: MavCmd,
9848 #[doc = "Result of command."]
9849 pub result: MavResult,
9850 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
9851 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9852 pub progress: u8,
9853 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
9854 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9855 pub result_param2: i32,
9856 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9857 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9858 pub target_system: u8,
9859 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9860 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9861 pub target_component: u8,
9862}
9863impl COMMAND_ACK_DATA {
9864 pub const ENCODED_LEN: usize = 10usize;
9865 pub const DEFAULT: Self = Self {
9866 command: MavCmd::DEFAULT,
9867 result: MavResult::DEFAULT,
9868 progress: 0_u8,
9869 result_param2: 0_i32,
9870 target_system: 0_u8,
9871 target_component: 0_u8,
9872 };
9873 #[cfg(feature = "arbitrary")]
9874 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9875 use arbitrary::{Arbitrary, Unstructured};
9876 let mut buf = [0u8; 1024];
9877 rng.fill_bytes(&mut buf);
9878 let mut unstructured = Unstructured::new(&buf);
9879 Self::arbitrary(&mut unstructured).unwrap_or_default()
9880 }
9881}
9882impl Default for COMMAND_ACK_DATA {
9883 fn default() -> Self {
9884 Self::DEFAULT.clone()
9885 }
9886}
9887impl MessageData for COMMAND_ACK_DATA {
9888 type Message = MavMessage;
9889 const ID: u32 = 77u32;
9890 const NAME: &'static str = "COMMAND_ACK";
9891 const EXTRA_CRC: u8 = 143u8;
9892 const ENCODED_LEN: usize = 10usize;
9893 fn deser(
9894 _version: MavlinkVersion,
9895 __input: &[u8],
9896 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9897 let avail_len = __input.len();
9898 let mut payload_buf = [0; Self::ENCODED_LEN];
9899 let mut buf = if avail_len < Self::ENCODED_LEN {
9900 payload_buf[0..avail_len].copy_from_slice(__input);
9901 Bytes::new(&payload_buf)
9902 } else {
9903 Bytes::new(__input)
9904 };
9905 let mut __struct = Self::default();
9906 let tmp = buf.get_u16_le()?;
9907 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9908 ::mavlink_core::error::ParserError::InvalidEnum {
9909 enum_type: "MavCmd",
9910 value: tmp as u64,
9911 },
9912 )?;
9913 let tmp = buf.get_u8()?;
9914 __struct.result =
9915 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9916 enum_type: "MavResult",
9917 value: tmp as u64,
9918 })?;
9919 __struct.progress = buf.get_u8()?;
9920 __struct.result_param2 = buf.get_i32_le()?;
9921 __struct.target_system = buf.get_u8()?;
9922 __struct.target_component = buf.get_u8()?;
9923 Ok(__struct)
9924 }
9925 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9926 let mut __tmp = BytesMut::new(bytes);
9927 #[allow(clippy::absurd_extreme_comparisons)]
9928 #[allow(unused_comparisons)]
9929 if __tmp.remaining() < Self::ENCODED_LEN {
9930 panic!(
9931 "buffer is too small (need {} bytes, but got {})",
9932 Self::ENCODED_LEN,
9933 __tmp.remaining(),
9934 )
9935 }
9936 __tmp.put_u16_le(self.command as u16);
9937 __tmp.put_u8(self.result as u8);
9938 if matches!(version, MavlinkVersion::V2) {
9939 __tmp.put_u8(self.progress);
9940 __tmp.put_i32_le(self.result_param2);
9941 __tmp.put_u8(self.target_system);
9942 __tmp.put_u8(self.target_component);
9943 let len = __tmp.len();
9944 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9945 } else {
9946 __tmp.len()
9947 }
9948 }
9949}
9950#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9951#[doc = ""]
9952#[doc = "ID: 80"]
9953#[derive(Debug, Clone, PartialEq)]
9954#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9955#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9956#[cfg_attr(feature = "ts", derive(TS))]
9957#[cfg_attr(feature = "ts", ts(export))]
9958pub struct COMMAND_CANCEL_DATA {
9959 #[doc = "Command ID (of command to cancel)."]
9960 pub command: MavCmd,
9961 #[doc = "System executing long running command. Should not be broadcast (0)."]
9962 pub target_system: u8,
9963 #[doc = "Component executing long running command."]
9964 pub target_component: u8,
9965}
9966impl COMMAND_CANCEL_DATA {
9967 pub const ENCODED_LEN: usize = 4usize;
9968 pub const DEFAULT: Self = Self {
9969 command: MavCmd::DEFAULT,
9970 target_system: 0_u8,
9971 target_component: 0_u8,
9972 };
9973 #[cfg(feature = "arbitrary")]
9974 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9975 use arbitrary::{Arbitrary, Unstructured};
9976 let mut buf = [0u8; 1024];
9977 rng.fill_bytes(&mut buf);
9978 let mut unstructured = Unstructured::new(&buf);
9979 Self::arbitrary(&mut unstructured).unwrap_or_default()
9980 }
9981}
9982impl Default for COMMAND_CANCEL_DATA {
9983 fn default() -> Self {
9984 Self::DEFAULT.clone()
9985 }
9986}
9987impl MessageData for COMMAND_CANCEL_DATA {
9988 type Message = MavMessage;
9989 const ID: u32 = 80u32;
9990 const NAME: &'static str = "COMMAND_CANCEL";
9991 const EXTRA_CRC: u8 = 14u8;
9992 const ENCODED_LEN: usize = 4usize;
9993 fn deser(
9994 _version: MavlinkVersion,
9995 __input: &[u8],
9996 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9997 let avail_len = __input.len();
9998 let mut payload_buf = [0; Self::ENCODED_LEN];
9999 let mut buf = if avail_len < Self::ENCODED_LEN {
10000 payload_buf[0..avail_len].copy_from_slice(__input);
10001 Bytes::new(&payload_buf)
10002 } else {
10003 Bytes::new(__input)
10004 };
10005 let mut __struct = Self::default();
10006 let tmp = buf.get_u16_le()?;
10007 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
10008 ::mavlink_core::error::ParserError::InvalidEnum {
10009 enum_type: "MavCmd",
10010 value: tmp as u64,
10011 },
10012 )?;
10013 __struct.target_system = buf.get_u8()?;
10014 __struct.target_component = buf.get_u8()?;
10015 Ok(__struct)
10016 }
10017 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10018 let mut __tmp = BytesMut::new(bytes);
10019 #[allow(clippy::absurd_extreme_comparisons)]
10020 #[allow(unused_comparisons)]
10021 if __tmp.remaining() < Self::ENCODED_LEN {
10022 panic!(
10023 "buffer is too small (need {} bytes, but got {})",
10024 Self::ENCODED_LEN,
10025 __tmp.remaining(),
10026 )
10027 }
10028 __tmp.put_u16_le(self.command as u16);
10029 __tmp.put_u8(self.target_system);
10030 __tmp.put_u8(self.target_component);
10031 if matches!(version, MavlinkVersion::V2) {
10032 let len = __tmp.len();
10033 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10034 } else {
10035 __tmp.len()
10036 }
10037 }
10038}
10039#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
10040#[doc = ""]
10041#[doc = "ID: 75"]
10042#[derive(Debug, Clone, PartialEq)]
10043#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10044#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10045#[cfg_attr(feature = "ts", derive(TS))]
10046#[cfg_attr(feature = "ts", ts(export))]
10047pub struct COMMAND_INT_DATA {
10048 #[doc = "PARAM1, see MAV_CMD enum"]
10049 pub param1: f32,
10050 #[doc = "PARAM2, see MAV_CMD enum"]
10051 pub param2: f32,
10052 #[doc = "PARAM3, see MAV_CMD enum"]
10053 pub param3: f32,
10054 #[doc = "PARAM4, see MAV_CMD enum"]
10055 pub param4: f32,
10056 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
10057 pub x: i32,
10058 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
10059 pub y: i32,
10060 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
10061 pub z: f32,
10062 #[doc = "The scheduled action for the mission item."]
10063 pub command: MavCmd,
10064 #[doc = "System ID"]
10065 pub target_system: u8,
10066 #[doc = "Component ID"]
10067 pub target_component: u8,
10068 #[doc = "The coordinate system of the COMMAND."]
10069 pub frame: MavFrame,
10070 #[doc = "Not used."]
10071 pub current: u8,
10072 #[doc = "Not used (set 0)."]
10073 pub autocontinue: u8,
10074}
10075impl COMMAND_INT_DATA {
10076 pub const ENCODED_LEN: usize = 35usize;
10077 pub const DEFAULT: Self = Self {
10078 param1: 0.0_f32,
10079 param2: 0.0_f32,
10080 param3: 0.0_f32,
10081 param4: 0.0_f32,
10082 x: 0_i32,
10083 y: 0_i32,
10084 z: 0.0_f32,
10085 command: MavCmd::DEFAULT,
10086 target_system: 0_u8,
10087 target_component: 0_u8,
10088 frame: MavFrame::DEFAULT,
10089 current: 0_u8,
10090 autocontinue: 0_u8,
10091 };
10092 #[cfg(feature = "arbitrary")]
10093 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10094 use arbitrary::{Arbitrary, Unstructured};
10095 let mut buf = [0u8; 1024];
10096 rng.fill_bytes(&mut buf);
10097 let mut unstructured = Unstructured::new(&buf);
10098 Self::arbitrary(&mut unstructured).unwrap_or_default()
10099 }
10100}
10101impl Default for COMMAND_INT_DATA {
10102 fn default() -> Self {
10103 Self::DEFAULT.clone()
10104 }
10105}
10106impl MessageData for COMMAND_INT_DATA {
10107 type Message = MavMessage;
10108 const ID: u32 = 75u32;
10109 const NAME: &'static str = "COMMAND_INT";
10110 const EXTRA_CRC: u8 = 158u8;
10111 const ENCODED_LEN: usize = 35usize;
10112 fn deser(
10113 _version: MavlinkVersion,
10114 __input: &[u8],
10115 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10116 let avail_len = __input.len();
10117 let mut payload_buf = [0; Self::ENCODED_LEN];
10118 let mut buf = if avail_len < Self::ENCODED_LEN {
10119 payload_buf[0..avail_len].copy_from_slice(__input);
10120 Bytes::new(&payload_buf)
10121 } else {
10122 Bytes::new(__input)
10123 };
10124 let mut __struct = Self::default();
10125 __struct.param1 = buf.get_f32_le()?;
10126 __struct.param2 = buf.get_f32_le()?;
10127 __struct.param3 = buf.get_f32_le()?;
10128 __struct.param4 = buf.get_f32_le()?;
10129 __struct.x = buf.get_i32_le()?;
10130 __struct.y = buf.get_i32_le()?;
10131 __struct.z = buf.get_f32_le()?;
10132 let tmp = buf.get_u16_le()?;
10133 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
10134 ::mavlink_core::error::ParserError::InvalidEnum {
10135 enum_type: "MavCmd",
10136 value: tmp as u64,
10137 },
10138 )?;
10139 __struct.target_system = buf.get_u8()?;
10140 __struct.target_component = buf.get_u8()?;
10141 let tmp = buf.get_u8()?;
10142 __struct.frame =
10143 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10144 enum_type: "MavFrame",
10145 value: tmp as u64,
10146 })?;
10147 __struct.current = buf.get_u8()?;
10148 __struct.autocontinue = buf.get_u8()?;
10149 Ok(__struct)
10150 }
10151 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10152 let mut __tmp = BytesMut::new(bytes);
10153 #[allow(clippy::absurd_extreme_comparisons)]
10154 #[allow(unused_comparisons)]
10155 if __tmp.remaining() < Self::ENCODED_LEN {
10156 panic!(
10157 "buffer is too small (need {} bytes, but got {})",
10158 Self::ENCODED_LEN,
10159 __tmp.remaining(),
10160 )
10161 }
10162 __tmp.put_f32_le(self.param1);
10163 __tmp.put_f32_le(self.param2);
10164 __tmp.put_f32_le(self.param3);
10165 __tmp.put_f32_le(self.param4);
10166 __tmp.put_i32_le(self.x);
10167 __tmp.put_i32_le(self.y);
10168 __tmp.put_f32_le(self.z);
10169 __tmp.put_u16_le(self.command as u16);
10170 __tmp.put_u8(self.target_system);
10171 __tmp.put_u8(self.target_component);
10172 __tmp.put_u8(self.frame as u8);
10173 __tmp.put_u8(self.current);
10174 __tmp.put_u8(self.autocontinue);
10175 if matches!(version, MavlinkVersion::V2) {
10176 let len = __tmp.len();
10177 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10178 } else {
10179 __tmp.len()
10180 }
10181 }
10182}
10183#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
10184#[doc = ""]
10185#[doc = "ID: 76"]
10186#[derive(Debug, Clone, PartialEq)]
10187#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10188#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10189#[cfg_attr(feature = "ts", derive(TS))]
10190#[cfg_attr(feature = "ts", ts(export))]
10191pub struct COMMAND_LONG_DATA {
10192 #[doc = "Parameter 1 (for the specific command)."]
10193 pub param1: f32,
10194 #[doc = "Parameter 2 (for the specific command)."]
10195 pub param2: f32,
10196 #[doc = "Parameter 3 (for the specific command)."]
10197 pub param3: f32,
10198 #[doc = "Parameter 4 (for the specific command)."]
10199 pub param4: f32,
10200 #[doc = "Parameter 5 (for the specific command)."]
10201 pub param5: f32,
10202 #[doc = "Parameter 6 (for the specific command)."]
10203 pub param6: f32,
10204 #[doc = "Parameter 7 (for the specific command)."]
10205 pub param7: f32,
10206 #[doc = "Command ID (of command to send)."]
10207 pub command: MavCmd,
10208 #[doc = "System which should execute the command"]
10209 pub target_system: u8,
10210 #[doc = "Component which should execute the command, 0 for all components"]
10211 pub target_component: u8,
10212 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
10213 pub confirmation: u8,
10214}
10215impl COMMAND_LONG_DATA {
10216 pub const ENCODED_LEN: usize = 33usize;
10217 pub const DEFAULT: Self = Self {
10218 param1: 0.0_f32,
10219 param2: 0.0_f32,
10220 param3: 0.0_f32,
10221 param4: 0.0_f32,
10222 param5: 0.0_f32,
10223 param6: 0.0_f32,
10224 param7: 0.0_f32,
10225 command: MavCmd::DEFAULT,
10226 target_system: 0_u8,
10227 target_component: 0_u8,
10228 confirmation: 0_u8,
10229 };
10230 #[cfg(feature = "arbitrary")]
10231 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10232 use arbitrary::{Arbitrary, Unstructured};
10233 let mut buf = [0u8; 1024];
10234 rng.fill_bytes(&mut buf);
10235 let mut unstructured = Unstructured::new(&buf);
10236 Self::arbitrary(&mut unstructured).unwrap_or_default()
10237 }
10238}
10239impl Default for COMMAND_LONG_DATA {
10240 fn default() -> Self {
10241 Self::DEFAULT.clone()
10242 }
10243}
10244impl MessageData for COMMAND_LONG_DATA {
10245 type Message = MavMessage;
10246 const ID: u32 = 76u32;
10247 const NAME: &'static str = "COMMAND_LONG";
10248 const EXTRA_CRC: u8 = 152u8;
10249 const ENCODED_LEN: usize = 33usize;
10250 fn deser(
10251 _version: MavlinkVersion,
10252 __input: &[u8],
10253 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10254 let avail_len = __input.len();
10255 let mut payload_buf = [0; Self::ENCODED_LEN];
10256 let mut buf = if avail_len < Self::ENCODED_LEN {
10257 payload_buf[0..avail_len].copy_from_slice(__input);
10258 Bytes::new(&payload_buf)
10259 } else {
10260 Bytes::new(__input)
10261 };
10262 let mut __struct = Self::default();
10263 __struct.param1 = buf.get_f32_le()?;
10264 __struct.param2 = buf.get_f32_le()?;
10265 __struct.param3 = buf.get_f32_le()?;
10266 __struct.param4 = buf.get_f32_le()?;
10267 __struct.param5 = buf.get_f32_le()?;
10268 __struct.param6 = buf.get_f32_le()?;
10269 __struct.param7 = buf.get_f32_le()?;
10270 let tmp = buf.get_u16_le()?;
10271 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
10272 ::mavlink_core::error::ParserError::InvalidEnum {
10273 enum_type: "MavCmd",
10274 value: tmp as u64,
10275 },
10276 )?;
10277 __struct.target_system = buf.get_u8()?;
10278 __struct.target_component = buf.get_u8()?;
10279 __struct.confirmation = buf.get_u8()?;
10280 Ok(__struct)
10281 }
10282 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10283 let mut __tmp = BytesMut::new(bytes);
10284 #[allow(clippy::absurd_extreme_comparisons)]
10285 #[allow(unused_comparisons)]
10286 if __tmp.remaining() < Self::ENCODED_LEN {
10287 panic!(
10288 "buffer is too small (need {} bytes, but got {})",
10289 Self::ENCODED_LEN,
10290 __tmp.remaining(),
10291 )
10292 }
10293 __tmp.put_f32_le(self.param1);
10294 __tmp.put_f32_le(self.param2);
10295 __tmp.put_f32_le(self.param3);
10296 __tmp.put_f32_le(self.param4);
10297 __tmp.put_f32_le(self.param5);
10298 __tmp.put_f32_le(self.param6);
10299 __tmp.put_f32_le(self.param7);
10300 __tmp.put_u16_le(self.command as u16);
10301 __tmp.put_u8(self.target_system);
10302 __tmp.put_u8(self.target_component);
10303 __tmp.put_u8(self.confirmation);
10304 if matches!(version, MavlinkVersion::V2) {
10305 let len = __tmp.len();
10306 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10307 } else {
10308 __tmp.len()
10309 }
10310 }
10311}
10312#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
10313#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
10314#[doc = ""]
10315#[doc = "ID: 395"]
10316#[derive(Debug, Clone, PartialEq)]
10317#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10318#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10319#[cfg_attr(feature = "ts", derive(TS))]
10320#[cfg_attr(feature = "ts", ts(export))]
10321pub struct COMPONENT_INFORMATION_DATA {
10322 #[doc = "Timestamp (time since system boot)."]
10323 pub time_boot_ms: u32,
10324 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
10325 pub general_metadata_file_crc: u32,
10326 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
10327 pub peripherals_metadata_file_crc: u32,
10328 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
10329 #[cfg_attr(feature = "ts", ts(type = "string"))]
10330 pub general_metadata_uri: CharArray<100>,
10331 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
10332 #[cfg_attr(feature = "ts", ts(type = "string"))]
10333 pub peripherals_metadata_uri: CharArray<100>,
10334}
10335impl COMPONENT_INFORMATION_DATA {
10336 pub const ENCODED_LEN: usize = 212usize;
10337 pub const DEFAULT: Self = Self {
10338 time_boot_ms: 0_u32,
10339 general_metadata_file_crc: 0_u32,
10340 peripherals_metadata_file_crc: 0_u32,
10341 general_metadata_uri: CharArray::new([0_u8; 100usize]),
10342 peripherals_metadata_uri: CharArray::new([0_u8; 100usize]),
10343 };
10344 #[cfg(feature = "arbitrary")]
10345 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10346 use arbitrary::{Arbitrary, Unstructured};
10347 let mut buf = [0u8; 1024];
10348 rng.fill_bytes(&mut buf);
10349 let mut unstructured = Unstructured::new(&buf);
10350 Self::arbitrary(&mut unstructured).unwrap_or_default()
10351 }
10352}
10353impl Default for COMPONENT_INFORMATION_DATA {
10354 fn default() -> Self {
10355 Self::DEFAULT.clone()
10356 }
10357}
10358impl MessageData for COMPONENT_INFORMATION_DATA {
10359 type Message = MavMessage;
10360 const ID: u32 = 395u32;
10361 const NAME: &'static str = "COMPONENT_INFORMATION";
10362 const EXTRA_CRC: u8 = 0u8;
10363 const ENCODED_LEN: usize = 212usize;
10364 fn deser(
10365 _version: MavlinkVersion,
10366 __input: &[u8],
10367 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10368 let avail_len = __input.len();
10369 let mut payload_buf = [0; Self::ENCODED_LEN];
10370 let mut buf = if avail_len < Self::ENCODED_LEN {
10371 payload_buf[0..avail_len].copy_from_slice(__input);
10372 Bytes::new(&payload_buf)
10373 } else {
10374 Bytes::new(__input)
10375 };
10376 let mut __struct = Self::default();
10377 __struct.time_boot_ms = buf.get_u32_le()?;
10378 __struct.general_metadata_file_crc = buf.get_u32_le()?;
10379 __struct.peripherals_metadata_file_crc = buf.get_u32_le()?;
10380 let mut tmp = [0_u8; 100usize];
10381 for v in &mut tmp {
10382 *v = buf.get_u8()?;
10383 }
10384 __struct.general_metadata_uri = CharArray::new(tmp);
10385 let mut tmp = [0_u8; 100usize];
10386 for v in &mut tmp {
10387 *v = buf.get_u8()?;
10388 }
10389 __struct.peripherals_metadata_uri = CharArray::new(tmp);
10390 Ok(__struct)
10391 }
10392 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10393 let mut __tmp = BytesMut::new(bytes);
10394 #[allow(clippy::absurd_extreme_comparisons)]
10395 #[allow(unused_comparisons)]
10396 if __tmp.remaining() < Self::ENCODED_LEN {
10397 panic!(
10398 "buffer is too small (need {} bytes, but got {})",
10399 Self::ENCODED_LEN,
10400 __tmp.remaining(),
10401 )
10402 }
10403 __tmp.put_u32_le(self.time_boot_ms);
10404 __tmp.put_u32_le(self.general_metadata_file_crc);
10405 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
10406 for val in &self.general_metadata_uri {
10407 __tmp.put_u8(*val);
10408 }
10409 for val in &self.peripherals_metadata_uri {
10410 __tmp.put_u8(*val);
10411 }
10412 if matches!(version, MavlinkVersion::V2) {
10413 let len = __tmp.len();
10414 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10415 } else {
10416 __tmp.len()
10417 }
10418 }
10419}
10420#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
10421#[doc = ""]
10422#[doc = "ID: 396"]
10423#[derive(Debug, Clone, PartialEq)]
10424#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10425#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10426#[cfg_attr(feature = "ts", derive(TS))]
10427#[cfg_attr(feature = "ts", ts(export))]
10428pub struct COMPONENT_INFORMATION_BASIC_DATA {
10429 #[doc = "Component capability flags"]
10430 pub capabilities: MavProtocolCapability,
10431 #[doc = "Timestamp (time since system boot)."]
10432 pub time_boot_ms: u32,
10433 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
10434 pub time_manufacture_s: u32,
10435 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
10436 #[cfg_attr(feature = "ts", ts(type = "string"))]
10437 pub vendor_name: CharArray<32>,
10438 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
10439 #[cfg_attr(feature = "ts", ts(type = "string"))]
10440 pub model_name: CharArray<32>,
10441 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
10442 #[cfg_attr(feature = "ts", ts(type = "string"))]
10443 pub software_version: CharArray<24>,
10444 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
10445 #[cfg_attr(feature = "ts", ts(type = "string"))]
10446 pub hardware_version: CharArray<24>,
10447 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
10448 #[cfg_attr(feature = "ts", ts(type = "string"))]
10449 pub serial_number: CharArray<32>,
10450}
10451impl COMPONENT_INFORMATION_BASIC_DATA {
10452 pub const ENCODED_LEN: usize = 160usize;
10453 pub const DEFAULT: Self = Self {
10454 capabilities: MavProtocolCapability::DEFAULT,
10455 time_boot_ms: 0_u32,
10456 time_manufacture_s: 0_u32,
10457 vendor_name: CharArray::new([0_u8; 32usize]),
10458 model_name: CharArray::new([0_u8; 32usize]),
10459 software_version: CharArray::new([0_u8; 24usize]),
10460 hardware_version: CharArray::new([0_u8; 24usize]),
10461 serial_number: CharArray::new([0_u8; 32usize]),
10462 };
10463 #[cfg(feature = "arbitrary")]
10464 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10465 use arbitrary::{Arbitrary, Unstructured};
10466 let mut buf = [0u8; 1024];
10467 rng.fill_bytes(&mut buf);
10468 let mut unstructured = Unstructured::new(&buf);
10469 Self::arbitrary(&mut unstructured).unwrap_or_default()
10470 }
10471}
10472impl Default for COMPONENT_INFORMATION_BASIC_DATA {
10473 fn default() -> Self {
10474 Self::DEFAULT.clone()
10475 }
10476}
10477impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
10478 type Message = MavMessage;
10479 const ID: u32 = 396u32;
10480 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
10481 const EXTRA_CRC: u8 = 50u8;
10482 const ENCODED_LEN: usize = 160usize;
10483 fn deser(
10484 _version: MavlinkVersion,
10485 __input: &[u8],
10486 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10487 let avail_len = __input.len();
10488 let mut payload_buf = [0; Self::ENCODED_LEN];
10489 let mut buf = if avail_len < Self::ENCODED_LEN {
10490 payload_buf[0..avail_len].copy_from_slice(__input);
10491 Bytes::new(&payload_buf)
10492 } else {
10493 Bytes::new(__input)
10494 };
10495 let mut __struct = Self::default();
10496 let tmp = buf.get_u64_le()?;
10497 __struct.capabilities = MavProtocolCapability::from_bits(
10498 tmp as <MavProtocolCapability as Flags>::Bits,
10499 )
10500 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
10501 flag_type: "MavProtocolCapability",
10502 value: tmp as u64,
10503 })?;
10504 __struct.time_boot_ms = buf.get_u32_le()?;
10505 __struct.time_manufacture_s = buf.get_u32_le()?;
10506 let mut tmp = [0_u8; 32usize];
10507 for v in &mut tmp {
10508 *v = buf.get_u8()?;
10509 }
10510 __struct.vendor_name = CharArray::new(tmp);
10511 let mut tmp = [0_u8; 32usize];
10512 for v in &mut tmp {
10513 *v = buf.get_u8()?;
10514 }
10515 __struct.model_name = CharArray::new(tmp);
10516 let mut tmp = [0_u8; 24usize];
10517 for v in &mut tmp {
10518 *v = buf.get_u8()?;
10519 }
10520 __struct.software_version = CharArray::new(tmp);
10521 let mut tmp = [0_u8; 24usize];
10522 for v in &mut tmp {
10523 *v = buf.get_u8()?;
10524 }
10525 __struct.hardware_version = CharArray::new(tmp);
10526 let mut tmp = [0_u8; 32usize];
10527 for v in &mut tmp {
10528 *v = buf.get_u8()?;
10529 }
10530 __struct.serial_number = CharArray::new(tmp);
10531 Ok(__struct)
10532 }
10533 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10534 let mut __tmp = BytesMut::new(bytes);
10535 #[allow(clippy::absurd_extreme_comparisons)]
10536 #[allow(unused_comparisons)]
10537 if __tmp.remaining() < Self::ENCODED_LEN {
10538 panic!(
10539 "buffer is too small (need {} bytes, but got {})",
10540 Self::ENCODED_LEN,
10541 __tmp.remaining(),
10542 )
10543 }
10544 __tmp.put_u64_le(self.capabilities.bits() as u64);
10545 __tmp.put_u32_le(self.time_boot_ms);
10546 __tmp.put_u32_le(self.time_manufacture_s);
10547 for val in &self.vendor_name {
10548 __tmp.put_u8(*val);
10549 }
10550 for val in &self.model_name {
10551 __tmp.put_u8(*val);
10552 }
10553 for val in &self.software_version {
10554 __tmp.put_u8(*val);
10555 }
10556 for val in &self.hardware_version {
10557 __tmp.put_u8(*val);
10558 }
10559 for val in &self.serial_number {
10560 __tmp.put_u8(*val);
10561 }
10562 if matches!(version, MavlinkVersion::V2) {
10563 let len = __tmp.len();
10564 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10565 } else {
10566 __tmp.len()
10567 }
10568 }
10569}
10570#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
10571#[doc = ""]
10572#[doc = "ID: 397"]
10573#[derive(Debug, Clone, PartialEq)]
10574#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10575#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10576#[cfg_attr(feature = "ts", derive(TS))]
10577#[cfg_attr(feature = "ts", ts(export))]
10578pub struct COMPONENT_METADATA_DATA {
10579 #[doc = "Timestamp (time since system boot)."]
10580 pub time_boot_ms: u32,
10581 #[doc = "CRC32 of the general metadata file."]
10582 pub file_crc: u32,
10583 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
10584 #[cfg_attr(feature = "ts", ts(type = "string"))]
10585 pub uri: CharArray<100>,
10586}
10587impl COMPONENT_METADATA_DATA {
10588 pub const ENCODED_LEN: usize = 108usize;
10589 pub const DEFAULT: Self = Self {
10590 time_boot_ms: 0_u32,
10591 file_crc: 0_u32,
10592 uri: CharArray::new([0_u8; 100usize]),
10593 };
10594 #[cfg(feature = "arbitrary")]
10595 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10596 use arbitrary::{Arbitrary, Unstructured};
10597 let mut buf = [0u8; 1024];
10598 rng.fill_bytes(&mut buf);
10599 let mut unstructured = Unstructured::new(&buf);
10600 Self::arbitrary(&mut unstructured).unwrap_or_default()
10601 }
10602}
10603impl Default for COMPONENT_METADATA_DATA {
10604 fn default() -> Self {
10605 Self::DEFAULT.clone()
10606 }
10607}
10608impl MessageData for COMPONENT_METADATA_DATA {
10609 type Message = MavMessage;
10610 const ID: u32 = 397u32;
10611 const NAME: &'static str = "COMPONENT_METADATA";
10612 const EXTRA_CRC: u8 = 182u8;
10613 const ENCODED_LEN: usize = 108usize;
10614 fn deser(
10615 _version: MavlinkVersion,
10616 __input: &[u8],
10617 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10618 let avail_len = __input.len();
10619 let mut payload_buf = [0; Self::ENCODED_LEN];
10620 let mut buf = if avail_len < Self::ENCODED_LEN {
10621 payload_buf[0..avail_len].copy_from_slice(__input);
10622 Bytes::new(&payload_buf)
10623 } else {
10624 Bytes::new(__input)
10625 };
10626 let mut __struct = Self::default();
10627 __struct.time_boot_ms = buf.get_u32_le()?;
10628 __struct.file_crc = buf.get_u32_le()?;
10629 let mut tmp = [0_u8; 100usize];
10630 for v in &mut tmp {
10631 *v = buf.get_u8()?;
10632 }
10633 __struct.uri = CharArray::new(tmp);
10634 Ok(__struct)
10635 }
10636 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10637 let mut __tmp = BytesMut::new(bytes);
10638 #[allow(clippy::absurd_extreme_comparisons)]
10639 #[allow(unused_comparisons)]
10640 if __tmp.remaining() < Self::ENCODED_LEN {
10641 panic!(
10642 "buffer is too small (need {} bytes, but got {})",
10643 Self::ENCODED_LEN,
10644 __tmp.remaining(),
10645 )
10646 }
10647 __tmp.put_u32_le(self.time_boot_ms);
10648 __tmp.put_u32_le(self.file_crc);
10649 for val in &self.uri {
10650 __tmp.put_u8(*val);
10651 }
10652 if matches!(version, MavlinkVersion::V2) {
10653 let len = __tmp.len();
10654 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10655 } else {
10656 __tmp.len()
10657 }
10658 }
10659}
10660#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
10661#[doc = ""]
10662#[doc = "ID: 146"]
10663#[derive(Debug, Clone, PartialEq)]
10664#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10665#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10666#[cfg_attr(feature = "ts", derive(TS))]
10667#[cfg_attr(feature = "ts", ts(export))]
10668pub struct CONTROL_SYSTEM_STATE_DATA {
10669 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10670 pub time_usec: u64,
10671 #[doc = "X acceleration in body frame"]
10672 pub x_acc: f32,
10673 #[doc = "Y acceleration in body frame"]
10674 pub y_acc: f32,
10675 #[doc = "Z acceleration in body frame"]
10676 pub z_acc: f32,
10677 #[doc = "X velocity in body frame"]
10678 pub x_vel: f32,
10679 #[doc = "Y velocity in body frame"]
10680 pub y_vel: f32,
10681 #[doc = "Z velocity in body frame"]
10682 pub z_vel: f32,
10683 #[doc = "X position in local frame"]
10684 pub x_pos: f32,
10685 #[doc = "Y position in local frame"]
10686 pub y_pos: f32,
10687 #[doc = "Z position in local frame"]
10688 pub z_pos: f32,
10689 #[doc = "Airspeed, set to -1 if unknown"]
10690 pub airspeed: f32,
10691 #[doc = "Variance of body velocity estimate"]
10692 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10693 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10694 pub vel_variance: [f32; 3],
10695 #[doc = "Variance in local position"]
10696 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10697 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10698 pub pos_variance: [f32; 3],
10699 #[doc = "The attitude, represented as Quaternion"]
10700 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10701 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
10702 pub q: [f32; 4],
10703 #[doc = "Angular rate in roll axis"]
10704 pub roll_rate: f32,
10705 #[doc = "Angular rate in pitch axis"]
10706 pub pitch_rate: f32,
10707 #[doc = "Angular rate in yaw axis"]
10708 pub yaw_rate: f32,
10709}
10710impl CONTROL_SYSTEM_STATE_DATA {
10711 pub const ENCODED_LEN: usize = 100usize;
10712 pub const DEFAULT: Self = Self {
10713 time_usec: 0_u64,
10714 x_acc: 0.0_f32,
10715 y_acc: 0.0_f32,
10716 z_acc: 0.0_f32,
10717 x_vel: 0.0_f32,
10718 y_vel: 0.0_f32,
10719 z_vel: 0.0_f32,
10720 x_pos: 0.0_f32,
10721 y_pos: 0.0_f32,
10722 z_pos: 0.0_f32,
10723 airspeed: 0.0_f32,
10724 vel_variance: [0.0_f32; 3usize],
10725 pos_variance: [0.0_f32; 3usize],
10726 q: [0.0_f32; 4usize],
10727 roll_rate: 0.0_f32,
10728 pitch_rate: 0.0_f32,
10729 yaw_rate: 0.0_f32,
10730 };
10731 #[cfg(feature = "arbitrary")]
10732 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10733 use arbitrary::{Arbitrary, Unstructured};
10734 let mut buf = [0u8; 1024];
10735 rng.fill_bytes(&mut buf);
10736 let mut unstructured = Unstructured::new(&buf);
10737 Self::arbitrary(&mut unstructured).unwrap_or_default()
10738 }
10739}
10740impl Default for CONTROL_SYSTEM_STATE_DATA {
10741 fn default() -> Self {
10742 Self::DEFAULT.clone()
10743 }
10744}
10745impl MessageData for CONTROL_SYSTEM_STATE_DATA {
10746 type Message = MavMessage;
10747 const ID: u32 = 146u32;
10748 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
10749 const EXTRA_CRC: u8 = 103u8;
10750 const ENCODED_LEN: usize = 100usize;
10751 fn deser(
10752 _version: MavlinkVersion,
10753 __input: &[u8],
10754 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10755 let avail_len = __input.len();
10756 let mut payload_buf = [0; Self::ENCODED_LEN];
10757 let mut buf = if avail_len < Self::ENCODED_LEN {
10758 payload_buf[0..avail_len].copy_from_slice(__input);
10759 Bytes::new(&payload_buf)
10760 } else {
10761 Bytes::new(__input)
10762 };
10763 let mut __struct = Self::default();
10764 __struct.time_usec = buf.get_u64_le()?;
10765 __struct.x_acc = buf.get_f32_le()?;
10766 __struct.y_acc = buf.get_f32_le()?;
10767 __struct.z_acc = buf.get_f32_le()?;
10768 __struct.x_vel = buf.get_f32_le()?;
10769 __struct.y_vel = buf.get_f32_le()?;
10770 __struct.z_vel = buf.get_f32_le()?;
10771 __struct.x_pos = buf.get_f32_le()?;
10772 __struct.y_pos = buf.get_f32_le()?;
10773 __struct.z_pos = buf.get_f32_le()?;
10774 __struct.airspeed = buf.get_f32_le()?;
10775 for v in &mut __struct.vel_variance {
10776 let val = buf.get_f32_le()?;
10777 *v = val;
10778 }
10779 for v in &mut __struct.pos_variance {
10780 let val = buf.get_f32_le()?;
10781 *v = val;
10782 }
10783 for v in &mut __struct.q {
10784 let val = buf.get_f32_le()?;
10785 *v = val;
10786 }
10787 __struct.roll_rate = buf.get_f32_le()?;
10788 __struct.pitch_rate = buf.get_f32_le()?;
10789 __struct.yaw_rate = buf.get_f32_le()?;
10790 Ok(__struct)
10791 }
10792 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10793 let mut __tmp = BytesMut::new(bytes);
10794 #[allow(clippy::absurd_extreme_comparisons)]
10795 #[allow(unused_comparisons)]
10796 if __tmp.remaining() < Self::ENCODED_LEN {
10797 panic!(
10798 "buffer is too small (need {} bytes, but got {})",
10799 Self::ENCODED_LEN,
10800 __tmp.remaining(),
10801 )
10802 }
10803 __tmp.put_u64_le(self.time_usec);
10804 __tmp.put_f32_le(self.x_acc);
10805 __tmp.put_f32_le(self.y_acc);
10806 __tmp.put_f32_le(self.z_acc);
10807 __tmp.put_f32_le(self.x_vel);
10808 __tmp.put_f32_le(self.y_vel);
10809 __tmp.put_f32_le(self.z_vel);
10810 __tmp.put_f32_le(self.x_pos);
10811 __tmp.put_f32_le(self.y_pos);
10812 __tmp.put_f32_le(self.z_pos);
10813 __tmp.put_f32_le(self.airspeed);
10814 for val in &self.vel_variance {
10815 __tmp.put_f32_le(*val);
10816 }
10817 for val in &self.pos_variance {
10818 __tmp.put_f32_le(*val);
10819 }
10820 for val in &self.q {
10821 __tmp.put_f32_le(*val);
10822 }
10823 __tmp.put_f32_le(self.roll_rate);
10824 __tmp.put_f32_le(self.pitch_rate);
10825 __tmp.put_f32_le(self.yaw_rate);
10826 if matches!(version, MavlinkVersion::V2) {
10827 let len = __tmp.len();
10828 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10829 } else {
10830 __tmp.len()
10831 }
10832 }
10833}
10834#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
10835#[doc = ""]
10836#[doc = "ID: 411"]
10837#[derive(Debug, Clone, PartialEq)]
10838#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10839#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10840#[cfg_attr(feature = "ts", derive(TS))]
10841#[cfg_attr(feature = "ts", ts(export))]
10842pub struct CURRENT_EVENT_SEQUENCE_DATA {
10843 #[doc = "Sequence number."]
10844 pub sequence: u16,
10845 #[doc = "Flag bitset."]
10846 pub flags: MavEventCurrentSequenceFlags,
10847}
10848impl CURRENT_EVENT_SEQUENCE_DATA {
10849 pub const ENCODED_LEN: usize = 3usize;
10850 pub const DEFAULT: Self = Self {
10851 sequence: 0_u16,
10852 flags: MavEventCurrentSequenceFlags::DEFAULT,
10853 };
10854 #[cfg(feature = "arbitrary")]
10855 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10856 use arbitrary::{Arbitrary, Unstructured};
10857 let mut buf = [0u8; 1024];
10858 rng.fill_bytes(&mut buf);
10859 let mut unstructured = Unstructured::new(&buf);
10860 Self::arbitrary(&mut unstructured).unwrap_or_default()
10861 }
10862}
10863impl Default for CURRENT_EVENT_SEQUENCE_DATA {
10864 fn default() -> Self {
10865 Self::DEFAULT.clone()
10866 }
10867}
10868impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
10869 type Message = MavMessage;
10870 const ID: u32 = 411u32;
10871 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
10872 const EXTRA_CRC: u8 = 106u8;
10873 const ENCODED_LEN: usize = 3usize;
10874 fn deser(
10875 _version: MavlinkVersion,
10876 __input: &[u8],
10877 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10878 let avail_len = __input.len();
10879 let mut payload_buf = [0; Self::ENCODED_LEN];
10880 let mut buf = if avail_len < Self::ENCODED_LEN {
10881 payload_buf[0..avail_len].copy_from_slice(__input);
10882 Bytes::new(&payload_buf)
10883 } else {
10884 Bytes::new(__input)
10885 };
10886 let mut __struct = Self::default();
10887 __struct.sequence = buf.get_u16_le()?;
10888 let tmp = buf.get_u8()?;
10889 __struct.flags =
10890 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10891 enum_type: "MavEventCurrentSequenceFlags",
10892 value: tmp as u64,
10893 })?;
10894 Ok(__struct)
10895 }
10896 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10897 let mut __tmp = BytesMut::new(bytes);
10898 #[allow(clippy::absurd_extreme_comparisons)]
10899 #[allow(unused_comparisons)]
10900 if __tmp.remaining() < Self::ENCODED_LEN {
10901 panic!(
10902 "buffer is too small (need {} bytes, but got {})",
10903 Self::ENCODED_LEN,
10904 __tmp.remaining(),
10905 )
10906 }
10907 __tmp.put_u16_le(self.sequence);
10908 __tmp.put_u8(self.flags as u8);
10909 if matches!(version, MavlinkVersion::V2) {
10910 let len = __tmp.len();
10911 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10912 } else {
10913 __tmp.len()
10914 }
10915 }
10916}
10917#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
10918#[doc = ""]
10919#[doc = "ID: 436"]
10920#[derive(Debug, Clone, PartialEq)]
10921#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10922#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10923#[cfg_attr(feature = "ts", derive(TS))]
10924#[cfg_attr(feature = "ts", ts(export))]
10925pub struct CURRENT_MODE_DATA {
10926 #[doc = "A bitfield for use for autopilot-specific flags"]
10927 pub custom_mode: u32,
10928 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
10929 pub intended_custom_mode: u32,
10930 #[doc = "Standard mode."]
10931 pub standard_mode: MavStandardMode,
10932}
10933impl CURRENT_MODE_DATA {
10934 pub const ENCODED_LEN: usize = 9usize;
10935 pub const DEFAULT: Self = Self {
10936 custom_mode: 0_u32,
10937 intended_custom_mode: 0_u32,
10938 standard_mode: MavStandardMode::DEFAULT,
10939 };
10940 #[cfg(feature = "arbitrary")]
10941 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10942 use arbitrary::{Arbitrary, Unstructured};
10943 let mut buf = [0u8; 1024];
10944 rng.fill_bytes(&mut buf);
10945 let mut unstructured = Unstructured::new(&buf);
10946 Self::arbitrary(&mut unstructured).unwrap_or_default()
10947 }
10948}
10949impl Default for CURRENT_MODE_DATA {
10950 fn default() -> Self {
10951 Self::DEFAULT.clone()
10952 }
10953}
10954impl MessageData for CURRENT_MODE_DATA {
10955 type Message = MavMessage;
10956 const ID: u32 = 436u32;
10957 const NAME: &'static str = "CURRENT_MODE";
10958 const EXTRA_CRC: u8 = 193u8;
10959 const ENCODED_LEN: usize = 9usize;
10960 fn deser(
10961 _version: MavlinkVersion,
10962 __input: &[u8],
10963 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10964 let avail_len = __input.len();
10965 let mut payload_buf = [0; Self::ENCODED_LEN];
10966 let mut buf = if avail_len < Self::ENCODED_LEN {
10967 payload_buf[0..avail_len].copy_from_slice(__input);
10968 Bytes::new(&payload_buf)
10969 } else {
10970 Bytes::new(__input)
10971 };
10972 let mut __struct = Self::default();
10973 __struct.custom_mode = buf.get_u32_le()?;
10974 __struct.intended_custom_mode = buf.get_u32_le()?;
10975 let tmp = buf.get_u8()?;
10976 __struct.standard_mode =
10977 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10978 enum_type: "MavStandardMode",
10979 value: tmp as u64,
10980 })?;
10981 Ok(__struct)
10982 }
10983 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10984 let mut __tmp = BytesMut::new(bytes);
10985 #[allow(clippy::absurd_extreme_comparisons)]
10986 #[allow(unused_comparisons)]
10987 if __tmp.remaining() < Self::ENCODED_LEN {
10988 panic!(
10989 "buffer is too small (need {} bytes, but got {})",
10990 Self::ENCODED_LEN,
10991 __tmp.remaining(),
10992 )
10993 }
10994 __tmp.put_u32_le(self.custom_mode);
10995 __tmp.put_u32_le(self.intended_custom_mode);
10996 __tmp.put_u8(self.standard_mode as u8);
10997 if matches!(version, MavlinkVersion::V2) {
10998 let len = __tmp.len();
10999 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11000 } else {
11001 __tmp.len()
11002 }
11003 }
11004}
11005#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
11006#[doc = "Data stream status information."]
11007#[doc = ""]
11008#[doc = "ID: 67"]
11009#[derive(Debug, Clone, PartialEq)]
11010#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11011#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11012#[cfg_attr(feature = "ts", derive(TS))]
11013#[cfg_attr(feature = "ts", ts(export))]
11014pub struct DATA_STREAM_DATA {
11015 #[doc = "The message rate"]
11016 pub message_rate: u16,
11017 #[doc = "The ID of the requested data stream"]
11018 pub stream_id: u8,
11019 #[doc = "1 stream is enabled, 0 stream is stopped."]
11020 pub on_off: u8,
11021}
11022impl DATA_STREAM_DATA {
11023 pub const ENCODED_LEN: usize = 4usize;
11024 pub const DEFAULT: Self = Self {
11025 message_rate: 0_u16,
11026 stream_id: 0_u8,
11027 on_off: 0_u8,
11028 };
11029 #[cfg(feature = "arbitrary")]
11030 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11031 use arbitrary::{Arbitrary, Unstructured};
11032 let mut buf = [0u8; 1024];
11033 rng.fill_bytes(&mut buf);
11034 let mut unstructured = Unstructured::new(&buf);
11035 Self::arbitrary(&mut unstructured).unwrap_or_default()
11036 }
11037}
11038impl Default for DATA_STREAM_DATA {
11039 fn default() -> Self {
11040 Self::DEFAULT.clone()
11041 }
11042}
11043impl MessageData for DATA_STREAM_DATA {
11044 type Message = MavMessage;
11045 const ID: u32 = 67u32;
11046 const NAME: &'static str = "DATA_STREAM";
11047 const EXTRA_CRC: u8 = 21u8;
11048 const ENCODED_LEN: usize = 4usize;
11049 fn deser(
11050 _version: MavlinkVersion,
11051 __input: &[u8],
11052 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11053 let avail_len = __input.len();
11054 let mut payload_buf = [0; Self::ENCODED_LEN];
11055 let mut buf = if avail_len < Self::ENCODED_LEN {
11056 payload_buf[0..avail_len].copy_from_slice(__input);
11057 Bytes::new(&payload_buf)
11058 } else {
11059 Bytes::new(__input)
11060 };
11061 let mut __struct = Self::default();
11062 __struct.message_rate = buf.get_u16_le()?;
11063 __struct.stream_id = buf.get_u8()?;
11064 __struct.on_off = buf.get_u8()?;
11065 Ok(__struct)
11066 }
11067 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11068 let mut __tmp = BytesMut::new(bytes);
11069 #[allow(clippy::absurd_extreme_comparisons)]
11070 #[allow(unused_comparisons)]
11071 if __tmp.remaining() < Self::ENCODED_LEN {
11072 panic!(
11073 "buffer is too small (need {} bytes, but got {})",
11074 Self::ENCODED_LEN,
11075 __tmp.remaining(),
11076 )
11077 }
11078 __tmp.put_u16_le(self.message_rate);
11079 __tmp.put_u8(self.stream_id);
11080 __tmp.put_u8(self.on_off);
11081 if matches!(version, MavlinkVersion::V2) {
11082 let len = __tmp.len();
11083 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11084 } else {
11085 __tmp.len()
11086 }
11087 }
11088}
11089#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
11090#[doc = ""]
11091#[doc = "ID: 130"]
11092#[derive(Debug, Clone, PartialEq)]
11093#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11094#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11095#[cfg_attr(feature = "ts", derive(TS))]
11096#[cfg_attr(feature = "ts", ts(export))]
11097pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
11098 #[doc = "total data size (set on ACK only)."]
11099 pub size: u32,
11100 #[doc = "Width of a matrix or image."]
11101 pub width: u16,
11102 #[doc = "Height of a matrix or image."]
11103 pub height: u16,
11104 #[doc = "Number of packets being sent (set on ACK only)."]
11105 pub packets: u16,
11106 #[doc = "Type of requested/acknowledged data."]
11107 pub mavtype: MavlinkDataStreamType,
11108 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
11109 pub payload: u8,
11110 #[doc = "JPEG quality. Values: [1-100]."]
11111 pub jpg_quality: u8,
11112}
11113impl DATA_TRANSMISSION_HANDSHAKE_DATA {
11114 pub const ENCODED_LEN: usize = 13usize;
11115 pub const DEFAULT: Self = Self {
11116 size: 0_u32,
11117 width: 0_u16,
11118 height: 0_u16,
11119 packets: 0_u16,
11120 mavtype: MavlinkDataStreamType::DEFAULT,
11121 payload: 0_u8,
11122 jpg_quality: 0_u8,
11123 };
11124 #[cfg(feature = "arbitrary")]
11125 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11126 use arbitrary::{Arbitrary, Unstructured};
11127 let mut buf = [0u8; 1024];
11128 rng.fill_bytes(&mut buf);
11129 let mut unstructured = Unstructured::new(&buf);
11130 Self::arbitrary(&mut unstructured).unwrap_or_default()
11131 }
11132}
11133impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
11134 fn default() -> Self {
11135 Self::DEFAULT.clone()
11136 }
11137}
11138impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
11139 type Message = MavMessage;
11140 const ID: u32 = 130u32;
11141 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
11142 const EXTRA_CRC: u8 = 29u8;
11143 const ENCODED_LEN: usize = 13usize;
11144 fn deser(
11145 _version: MavlinkVersion,
11146 __input: &[u8],
11147 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11148 let avail_len = __input.len();
11149 let mut payload_buf = [0; Self::ENCODED_LEN];
11150 let mut buf = if avail_len < Self::ENCODED_LEN {
11151 payload_buf[0..avail_len].copy_from_slice(__input);
11152 Bytes::new(&payload_buf)
11153 } else {
11154 Bytes::new(__input)
11155 };
11156 let mut __struct = Self::default();
11157 __struct.size = buf.get_u32_le()?;
11158 __struct.width = buf.get_u16_le()?;
11159 __struct.height = buf.get_u16_le()?;
11160 __struct.packets = buf.get_u16_le()?;
11161 let tmp = buf.get_u8()?;
11162 __struct.mavtype =
11163 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11164 enum_type: "MavlinkDataStreamType",
11165 value: tmp as u64,
11166 })?;
11167 __struct.payload = buf.get_u8()?;
11168 __struct.jpg_quality = buf.get_u8()?;
11169 Ok(__struct)
11170 }
11171 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11172 let mut __tmp = BytesMut::new(bytes);
11173 #[allow(clippy::absurd_extreme_comparisons)]
11174 #[allow(unused_comparisons)]
11175 if __tmp.remaining() < Self::ENCODED_LEN {
11176 panic!(
11177 "buffer is too small (need {} bytes, but got {})",
11178 Self::ENCODED_LEN,
11179 __tmp.remaining(),
11180 )
11181 }
11182 __tmp.put_u32_le(self.size);
11183 __tmp.put_u16_le(self.width);
11184 __tmp.put_u16_le(self.height);
11185 __tmp.put_u16_le(self.packets);
11186 __tmp.put_u8(self.mavtype as u8);
11187 __tmp.put_u8(self.payload);
11188 __tmp.put_u8(self.jpg_quality);
11189 if matches!(version, MavlinkVersion::V2) {
11190 let len = __tmp.len();
11191 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11192 } else {
11193 __tmp.len()
11194 }
11195 }
11196}
11197#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
11198#[doc = ""]
11199#[doc = "ID: 254"]
11200#[derive(Debug, Clone, PartialEq)]
11201#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11202#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11203#[cfg_attr(feature = "ts", derive(TS))]
11204#[cfg_attr(feature = "ts", ts(export))]
11205pub struct DEBUG_DATA {
11206 #[doc = "Timestamp (time since system boot)."]
11207 pub time_boot_ms: u32,
11208 #[doc = "DEBUG value"]
11209 pub value: f32,
11210 #[doc = "index of debug variable"]
11211 pub ind: u8,
11212}
11213impl DEBUG_DATA {
11214 pub const ENCODED_LEN: usize = 9usize;
11215 pub const DEFAULT: Self = Self {
11216 time_boot_ms: 0_u32,
11217 value: 0.0_f32,
11218 ind: 0_u8,
11219 };
11220 #[cfg(feature = "arbitrary")]
11221 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11222 use arbitrary::{Arbitrary, Unstructured};
11223 let mut buf = [0u8; 1024];
11224 rng.fill_bytes(&mut buf);
11225 let mut unstructured = Unstructured::new(&buf);
11226 Self::arbitrary(&mut unstructured).unwrap_or_default()
11227 }
11228}
11229impl Default for DEBUG_DATA {
11230 fn default() -> Self {
11231 Self::DEFAULT.clone()
11232 }
11233}
11234impl MessageData for DEBUG_DATA {
11235 type Message = MavMessage;
11236 const ID: u32 = 254u32;
11237 const NAME: &'static str = "DEBUG";
11238 const EXTRA_CRC: u8 = 46u8;
11239 const ENCODED_LEN: usize = 9usize;
11240 fn deser(
11241 _version: MavlinkVersion,
11242 __input: &[u8],
11243 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11244 let avail_len = __input.len();
11245 let mut payload_buf = [0; Self::ENCODED_LEN];
11246 let mut buf = if avail_len < Self::ENCODED_LEN {
11247 payload_buf[0..avail_len].copy_from_slice(__input);
11248 Bytes::new(&payload_buf)
11249 } else {
11250 Bytes::new(__input)
11251 };
11252 let mut __struct = Self::default();
11253 __struct.time_boot_ms = buf.get_u32_le()?;
11254 __struct.value = buf.get_f32_le()?;
11255 __struct.ind = buf.get_u8()?;
11256 Ok(__struct)
11257 }
11258 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11259 let mut __tmp = BytesMut::new(bytes);
11260 #[allow(clippy::absurd_extreme_comparisons)]
11261 #[allow(unused_comparisons)]
11262 if __tmp.remaining() < Self::ENCODED_LEN {
11263 panic!(
11264 "buffer is too small (need {} bytes, but got {})",
11265 Self::ENCODED_LEN,
11266 __tmp.remaining(),
11267 )
11268 }
11269 __tmp.put_u32_le(self.time_boot_ms);
11270 __tmp.put_f32_le(self.value);
11271 __tmp.put_u8(self.ind);
11272 if matches!(version, MavlinkVersion::V2) {
11273 let len = __tmp.len();
11274 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11275 } else {
11276 __tmp.len()
11277 }
11278 }
11279}
11280#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
11281#[doc = ""]
11282#[doc = "ID: 350"]
11283#[derive(Debug, Clone, PartialEq)]
11284#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11285#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11286#[cfg_attr(feature = "ts", derive(TS))]
11287#[cfg_attr(feature = "ts", ts(export))]
11288pub struct DEBUG_FLOAT_ARRAY_DATA {
11289 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11290 pub time_usec: u64,
11291 #[doc = "Unique ID used to discriminate between arrays"]
11292 pub array_id: u16,
11293 #[doc = "Name, for human-friendly display in a Ground Control Station"]
11294 #[cfg_attr(feature = "ts", ts(type = "string"))]
11295 pub name: CharArray<10>,
11296 #[doc = "data"]
11297 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11298 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11299 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11300 pub data: [f32; 58],
11301}
11302impl DEBUG_FLOAT_ARRAY_DATA {
11303 pub const ENCODED_LEN: usize = 252usize;
11304 pub const DEFAULT: Self = Self {
11305 time_usec: 0_u64,
11306 array_id: 0_u16,
11307 name: CharArray::new([0_u8; 10usize]),
11308 data: [0.0_f32; 58usize],
11309 };
11310 #[cfg(feature = "arbitrary")]
11311 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11312 use arbitrary::{Arbitrary, Unstructured};
11313 let mut buf = [0u8; 1024];
11314 rng.fill_bytes(&mut buf);
11315 let mut unstructured = Unstructured::new(&buf);
11316 Self::arbitrary(&mut unstructured).unwrap_or_default()
11317 }
11318}
11319impl Default for DEBUG_FLOAT_ARRAY_DATA {
11320 fn default() -> Self {
11321 Self::DEFAULT.clone()
11322 }
11323}
11324impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
11325 type Message = MavMessage;
11326 const ID: u32 = 350u32;
11327 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
11328 const EXTRA_CRC: u8 = 232u8;
11329 const ENCODED_LEN: usize = 252usize;
11330 fn deser(
11331 _version: MavlinkVersion,
11332 __input: &[u8],
11333 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11334 let avail_len = __input.len();
11335 let mut payload_buf = [0; Self::ENCODED_LEN];
11336 let mut buf = if avail_len < Self::ENCODED_LEN {
11337 payload_buf[0..avail_len].copy_from_slice(__input);
11338 Bytes::new(&payload_buf)
11339 } else {
11340 Bytes::new(__input)
11341 };
11342 let mut __struct = Self::default();
11343 __struct.time_usec = buf.get_u64_le()?;
11344 __struct.array_id = buf.get_u16_le()?;
11345 let mut tmp = [0_u8; 10usize];
11346 for v in &mut tmp {
11347 *v = buf.get_u8()?;
11348 }
11349 __struct.name = CharArray::new(tmp);
11350 for v in &mut __struct.data {
11351 let val = buf.get_f32_le()?;
11352 *v = val;
11353 }
11354 Ok(__struct)
11355 }
11356 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11357 let mut __tmp = BytesMut::new(bytes);
11358 #[allow(clippy::absurd_extreme_comparisons)]
11359 #[allow(unused_comparisons)]
11360 if __tmp.remaining() < Self::ENCODED_LEN {
11361 panic!(
11362 "buffer is too small (need {} bytes, but got {})",
11363 Self::ENCODED_LEN,
11364 __tmp.remaining(),
11365 )
11366 }
11367 __tmp.put_u64_le(self.time_usec);
11368 __tmp.put_u16_le(self.array_id);
11369 for val in &self.name {
11370 __tmp.put_u8(*val);
11371 }
11372 if matches!(version, MavlinkVersion::V2) {
11373 for val in &self.data {
11374 __tmp.put_f32_le(*val);
11375 }
11376 let len = __tmp.len();
11377 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11378 } else {
11379 __tmp.len()
11380 }
11381 }
11382}
11383#[doc = "To debug something using a named 3D vector."]
11384#[doc = ""]
11385#[doc = "ID: 250"]
11386#[derive(Debug, Clone, PartialEq)]
11387#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11388#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11389#[cfg_attr(feature = "ts", derive(TS))]
11390#[cfg_attr(feature = "ts", ts(export))]
11391pub struct DEBUG_VECT_DATA {
11392 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11393 pub time_usec: u64,
11394 #[doc = "x"]
11395 pub x: f32,
11396 #[doc = "y"]
11397 pub y: f32,
11398 #[doc = "z"]
11399 pub z: f32,
11400 #[doc = "Name"]
11401 #[cfg_attr(feature = "ts", ts(type = "string"))]
11402 pub name: CharArray<10>,
11403}
11404impl DEBUG_VECT_DATA {
11405 pub const ENCODED_LEN: usize = 30usize;
11406 pub const DEFAULT: Self = Self {
11407 time_usec: 0_u64,
11408 x: 0.0_f32,
11409 y: 0.0_f32,
11410 z: 0.0_f32,
11411 name: CharArray::new([0_u8; 10usize]),
11412 };
11413 #[cfg(feature = "arbitrary")]
11414 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11415 use arbitrary::{Arbitrary, Unstructured};
11416 let mut buf = [0u8; 1024];
11417 rng.fill_bytes(&mut buf);
11418 let mut unstructured = Unstructured::new(&buf);
11419 Self::arbitrary(&mut unstructured).unwrap_or_default()
11420 }
11421}
11422impl Default for DEBUG_VECT_DATA {
11423 fn default() -> Self {
11424 Self::DEFAULT.clone()
11425 }
11426}
11427impl MessageData for DEBUG_VECT_DATA {
11428 type Message = MavMessage;
11429 const ID: u32 = 250u32;
11430 const NAME: &'static str = "DEBUG_VECT";
11431 const EXTRA_CRC: u8 = 49u8;
11432 const ENCODED_LEN: usize = 30usize;
11433 fn deser(
11434 _version: MavlinkVersion,
11435 __input: &[u8],
11436 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11437 let avail_len = __input.len();
11438 let mut payload_buf = [0; Self::ENCODED_LEN];
11439 let mut buf = if avail_len < Self::ENCODED_LEN {
11440 payload_buf[0..avail_len].copy_from_slice(__input);
11441 Bytes::new(&payload_buf)
11442 } else {
11443 Bytes::new(__input)
11444 };
11445 let mut __struct = Self::default();
11446 __struct.time_usec = buf.get_u64_le()?;
11447 __struct.x = buf.get_f32_le()?;
11448 __struct.y = buf.get_f32_le()?;
11449 __struct.z = buf.get_f32_le()?;
11450 let mut tmp = [0_u8; 10usize];
11451 for v in &mut tmp {
11452 *v = buf.get_u8()?;
11453 }
11454 __struct.name = CharArray::new(tmp);
11455 Ok(__struct)
11456 }
11457 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11458 let mut __tmp = BytesMut::new(bytes);
11459 #[allow(clippy::absurd_extreme_comparisons)]
11460 #[allow(unused_comparisons)]
11461 if __tmp.remaining() < Self::ENCODED_LEN {
11462 panic!(
11463 "buffer is too small (need {} bytes, but got {})",
11464 Self::ENCODED_LEN,
11465 __tmp.remaining(),
11466 )
11467 }
11468 __tmp.put_u64_le(self.time_usec);
11469 __tmp.put_f32_le(self.x);
11470 __tmp.put_f32_le(self.y);
11471 __tmp.put_f32_le(self.z);
11472 for val in &self.name {
11473 __tmp.put_u8(*val);
11474 }
11475 if matches!(version, MavlinkVersion::V2) {
11476 let len = __tmp.len();
11477 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11478 } else {
11479 __tmp.len()
11480 }
11481 }
11482}
11483#[doc = "Distance sensor information for an onboard rangefinder."]
11484#[doc = ""]
11485#[doc = "ID: 132"]
11486#[derive(Debug, Clone, PartialEq)]
11487#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11488#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11489#[cfg_attr(feature = "ts", derive(TS))]
11490#[cfg_attr(feature = "ts", ts(export))]
11491pub struct DISTANCE_SENSOR_DATA {
11492 #[doc = "Timestamp (time since system boot)."]
11493 pub time_boot_ms: u32,
11494 #[doc = "Minimum distance the sensor can measure"]
11495 pub min_distance: u16,
11496 #[doc = "Maximum distance the sensor can measure"]
11497 pub max_distance: u16,
11498 #[doc = "Current distance reading"]
11499 pub current_distance: u16,
11500 #[doc = "Type of distance sensor."]
11501 pub mavtype: MavDistanceSensor,
11502 #[doc = "Onboard ID of the sensor"]
11503 pub id: u8,
11504 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
11505 pub orientation: MavSensorOrientation,
11506 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
11507 pub covariance: u8,
11508 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
11509 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11510 pub horizontal_fov: f32,
11511 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
11512 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11513 pub vertical_fov: f32,
11514 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
11515 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11516 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11517 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11518 pub quaternion: [f32; 4],
11519 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
11520 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11521 pub signal_quality: u8,
11522}
11523impl DISTANCE_SENSOR_DATA {
11524 pub const ENCODED_LEN: usize = 39usize;
11525 pub const DEFAULT: Self = Self {
11526 time_boot_ms: 0_u32,
11527 min_distance: 0_u16,
11528 max_distance: 0_u16,
11529 current_distance: 0_u16,
11530 mavtype: MavDistanceSensor::DEFAULT,
11531 id: 0_u8,
11532 orientation: MavSensorOrientation::DEFAULT,
11533 covariance: 0_u8,
11534 horizontal_fov: 0.0_f32,
11535 vertical_fov: 0.0_f32,
11536 quaternion: [0.0_f32; 4usize],
11537 signal_quality: 0_u8,
11538 };
11539 #[cfg(feature = "arbitrary")]
11540 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11541 use arbitrary::{Arbitrary, Unstructured};
11542 let mut buf = [0u8; 1024];
11543 rng.fill_bytes(&mut buf);
11544 let mut unstructured = Unstructured::new(&buf);
11545 Self::arbitrary(&mut unstructured).unwrap_or_default()
11546 }
11547}
11548impl Default for DISTANCE_SENSOR_DATA {
11549 fn default() -> Self {
11550 Self::DEFAULT.clone()
11551 }
11552}
11553impl MessageData for DISTANCE_SENSOR_DATA {
11554 type Message = MavMessage;
11555 const ID: u32 = 132u32;
11556 const NAME: &'static str = "DISTANCE_SENSOR";
11557 const EXTRA_CRC: u8 = 85u8;
11558 const ENCODED_LEN: usize = 39usize;
11559 fn deser(
11560 _version: MavlinkVersion,
11561 __input: &[u8],
11562 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11563 let avail_len = __input.len();
11564 let mut payload_buf = [0; Self::ENCODED_LEN];
11565 let mut buf = if avail_len < Self::ENCODED_LEN {
11566 payload_buf[0..avail_len].copy_from_slice(__input);
11567 Bytes::new(&payload_buf)
11568 } else {
11569 Bytes::new(__input)
11570 };
11571 let mut __struct = Self::default();
11572 __struct.time_boot_ms = buf.get_u32_le()?;
11573 __struct.min_distance = buf.get_u16_le()?;
11574 __struct.max_distance = buf.get_u16_le()?;
11575 __struct.current_distance = buf.get_u16_le()?;
11576 let tmp = buf.get_u8()?;
11577 __struct.mavtype =
11578 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11579 enum_type: "MavDistanceSensor",
11580 value: tmp as u64,
11581 })?;
11582 __struct.id = buf.get_u8()?;
11583 let tmp = buf.get_u8()?;
11584 __struct.orientation =
11585 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11586 enum_type: "MavSensorOrientation",
11587 value: tmp as u64,
11588 })?;
11589 __struct.covariance = buf.get_u8()?;
11590 __struct.horizontal_fov = buf.get_f32_le()?;
11591 __struct.vertical_fov = buf.get_f32_le()?;
11592 for v in &mut __struct.quaternion {
11593 let val = buf.get_f32_le()?;
11594 *v = val;
11595 }
11596 __struct.signal_quality = buf.get_u8()?;
11597 Ok(__struct)
11598 }
11599 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11600 let mut __tmp = BytesMut::new(bytes);
11601 #[allow(clippy::absurd_extreme_comparisons)]
11602 #[allow(unused_comparisons)]
11603 if __tmp.remaining() < Self::ENCODED_LEN {
11604 panic!(
11605 "buffer is too small (need {} bytes, but got {})",
11606 Self::ENCODED_LEN,
11607 __tmp.remaining(),
11608 )
11609 }
11610 __tmp.put_u32_le(self.time_boot_ms);
11611 __tmp.put_u16_le(self.min_distance);
11612 __tmp.put_u16_le(self.max_distance);
11613 __tmp.put_u16_le(self.current_distance);
11614 __tmp.put_u8(self.mavtype as u8);
11615 __tmp.put_u8(self.id);
11616 __tmp.put_u8(self.orientation as u8);
11617 __tmp.put_u8(self.covariance);
11618 if matches!(version, MavlinkVersion::V2) {
11619 __tmp.put_f32_le(self.horizontal_fov);
11620 __tmp.put_f32_le(self.vertical_fov);
11621 for val in &self.quaternion {
11622 __tmp.put_f32_le(*val);
11623 }
11624 __tmp.put_u8(self.signal_quality);
11625 let len = __tmp.len();
11626 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11627 } else {
11628 __tmp.len()
11629 }
11630 }
11631}
11632#[doc = "EFI status output."]
11633#[doc = ""]
11634#[doc = "ID: 225"]
11635#[derive(Debug, Clone, PartialEq)]
11636#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11637#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11638#[cfg_attr(feature = "ts", derive(TS))]
11639#[cfg_attr(feature = "ts", ts(export))]
11640pub struct EFI_STATUS_DATA {
11641 #[doc = "ECU index"]
11642 pub ecu_index: f32,
11643 #[doc = "RPM"]
11644 pub rpm: f32,
11645 #[doc = "Fuel consumed"]
11646 pub fuel_consumed: f32,
11647 #[doc = "Fuel flow rate"]
11648 pub fuel_flow: f32,
11649 #[doc = "Engine load"]
11650 pub engine_load: f32,
11651 #[doc = "Throttle position"]
11652 pub throttle_position: f32,
11653 #[doc = "Spark dwell time"]
11654 pub spark_dwell_time: f32,
11655 #[doc = "Barometric pressure"]
11656 pub barometric_pressure: f32,
11657 #[doc = "Intake manifold pressure("]
11658 pub intake_manifold_pressure: f32,
11659 #[doc = "Intake manifold temperature"]
11660 pub intake_manifold_temperature: f32,
11661 #[doc = "Cylinder head temperature"]
11662 pub cylinder_head_temperature: f32,
11663 #[doc = "Ignition timing (Crank angle degrees)"]
11664 pub ignition_timing: f32,
11665 #[doc = "Injection time"]
11666 pub injection_time: f32,
11667 #[doc = "Exhaust gas temperature"]
11668 pub exhaust_gas_temperature: f32,
11669 #[doc = "Output throttle"]
11670 pub throttle_out: f32,
11671 #[doc = "Pressure/temperature compensation"]
11672 pub pt_compensation: f32,
11673 #[doc = "EFI health status"]
11674 pub health: u8,
11675 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
11676 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11677 pub ignition_voltage: f32,
11678 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
11679 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11680 pub fuel_pressure: f32,
11681}
11682impl EFI_STATUS_DATA {
11683 pub const ENCODED_LEN: usize = 73usize;
11684 pub const DEFAULT: Self = Self {
11685 ecu_index: 0.0_f32,
11686 rpm: 0.0_f32,
11687 fuel_consumed: 0.0_f32,
11688 fuel_flow: 0.0_f32,
11689 engine_load: 0.0_f32,
11690 throttle_position: 0.0_f32,
11691 spark_dwell_time: 0.0_f32,
11692 barometric_pressure: 0.0_f32,
11693 intake_manifold_pressure: 0.0_f32,
11694 intake_manifold_temperature: 0.0_f32,
11695 cylinder_head_temperature: 0.0_f32,
11696 ignition_timing: 0.0_f32,
11697 injection_time: 0.0_f32,
11698 exhaust_gas_temperature: 0.0_f32,
11699 throttle_out: 0.0_f32,
11700 pt_compensation: 0.0_f32,
11701 health: 0_u8,
11702 ignition_voltage: 0.0_f32,
11703 fuel_pressure: 0.0_f32,
11704 };
11705 #[cfg(feature = "arbitrary")]
11706 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11707 use arbitrary::{Arbitrary, Unstructured};
11708 let mut buf = [0u8; 1024];
11709 rng.fill_bytes(&mut buf);
11710 let mut unstructured = Unstructured::new(&buf);
11711 Self::arbitrary(&mut unstructured).unwrap_or_default()
11712 }
11713}
11714impl Default for EFI_STATUS_DATA {
11715 fn default() -> Self {
11716 Self::DEFAULT.clone()
11717 }
11718}
11719impl MessageData for EFI_STATUS_DATA {
11720 type Message = MavMessage;
11721 const ID: u32 = 225u32;
11722 const NAME: &'static str = "EFI_STATUS";
11723 const EXTRA_CRC: u8 = 208u8;
11724 const ENCODED_LEN: usize = 73usize;
11725 fn deser(
11726 _version: MavlinkVersion,
11727 __input: &[u8],
11728 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11729 let avail_len = __input.len();
11730 let mut payload_buf = [0; Self::ENCODED_LEN];
11731 let mut buf = if avail_len < Self::ENCODED_LEN {
11732 payload_buf[0..avail_len].copy_from_slice(__input);
11733 Bytes::new(&payload_buf)
11734 } else {
11735 Bytes::new(__input)
11736 };
11737 let mut __struct = Self::default();
11738 __struct.ecu_index = buf.get_f32_le()?;
11739 __struct.rpm = buf.get_f32_le()?;
11740 __struct.fuel_consumed = buf.get_f32_le()?;
11741 __struct.fuel_flow = buf.get_f32_le()?;
11742 __struct.engine_load = buf.get_f32_le()?;
11743 __struct.throttle_position = buf.get_f32_le()?;
11744 __struct.spark_dwell_time = buf.get_f32_le()?;
11745 __struct.barometric_pressure = buf.get_f32_le()?;
11746 __struct.intake_manifold_pressure = buf.get_f32_le()?;
11747 __struct.intake_manifold_temperature = buf.get_f32_le()?;
11748 __struct.cylinder_head_temperature = buf.get_f32_le()?;
11749 __struct.ignition_timing = buf.get_f32_le()?;
11750 __struct.injection_time = buf.get_f32_le()?;
11751 __struct.exhaust_gas_temperature = buf.get_f32_le()?;
11752 __struct.throttle_out = buf.get_f32_le()?;
11753 __struct.pt_compensation = buf.get_f32_le()?;
11754 __struct.health = buf.get_u8()?;
11755 __struct.ignition_voltage = buf.get_f32_le()?;
11756 __struct.fuel_pressure = buf.get_f32_le()?;
11757 Ok(__struct)
11758 }
11759 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11760 let mut __tmp = BytesMut::new(bytes);
11761 #[allow(clippy::absurd_extreme_comparisons)]
11762 #[allow(unused_comparisons)]
11763 if __tmp.remaining() < Self::ENCODED_LEN {
11764 panic!(
11765 "buffer is too small (need {} bytes, but got {})",
11766 Self::ENCODED_LEN,
11767 __tmp.remaining(),
11768 )
11769 }
11770 __tmp.put_f32_le(self.ecu_index);
11771 __tmp.put_f32_le(self.rpm);
11772 __tmp.put_f32_le(self.fuel_consumed);
11773 __tmp.put_f32_le(self.fuel_flow);
11774 __tmp.put_f32_le(self.engine_load);
11775 __tmp.put_f32_le(self.throttle_position);
11776 __tmp.put_f32_le(self.spark_dwell_time);
11777 __tmp.put_f32_le(self.barometric_pressure);
11778 __tmp.put_f32_le(self.intake_manifold_pressure);
11779 __tmp.put_f32_le(self.intake_manifold_temperature);
11780 __tmp.put_f32_le(self.cylinder_head_temperature);
11781 __tmp.put_f32_le(self.ignition_timing);
11782 __tmp.put_f32_le(self.injection_time);
11783 __tmp.put_f32_le(self.exhaust_gas_temperature);
11784 __tmp.put_f32_le(self.throttle_out);
11785 __tmp.put_f32_le(self.pt_compensation);
11786 __tmp.put_u8(self.health);
11787 if matches!(version, MavlinkVersion::V2) {
11788 __tmp.put_f32_le(self.ignition_voltage);
11789 __tmp.put_f32_le(self.fuel_pressure);
11790 let len = __tmp.len();
11791 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11792 } else {
11793 __tmp.len()
11794 }
11795 }
11796}
11797#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
11798#[doc = ""]
11799#[doc = "ID: 131"]
11800#[derive(Debug, Clone, PartialEq)]
11801#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11802#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11803#[cfg_attr(feature = "ts", derive(TS))]
11804#[cfg_attr(feature = "ts", ts(export))]
11805pub struct ENCAPSULATED_DATA_DATA {
11806 #[doc = "sequence number (starting with 0 on every transmission)"]
11807 pub seqnr: u16,
11808 #[doc = "image data bytes"]
11809 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11810 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11811 pub data: [u8; 253],
11812}
11813impl ENCAPSULATED_DATA_DATA {
11814 pub const ENCODED_LEN: usize = 255usize;
11815 pub const DEFAULT: Self = Self {
11816 seqnr: 0_u16,
11817 data: [0_u8; 253usize],
11818 };
11819 #[cfg(feature = "arbitrary")]
11820 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11821 use arbitrary::{Arbitrary, Unstructured};
11822 let mut buf = [0u8; 1024];
11823 rng.fill_bytes(&mut buf);
11824 let mut unstructured = Unstructured::new(&buf);
11825 Self::arbitrary(&mut unstructured).unwrap_or_default()
11826 }
11827}
11828impl Default for ENCAPSULATED_DATA_DATA {
11829 fn default() -> Self {
11830 Self::DEFAULT.clone()
11831 }
11832}
11833impl MessageData for ENCAPSULATED_DATA_DATA {
11834 type Message = MavMessage;
11835 const ID: u32 = 131u32;
11836 const NAME: &'static str = "ENCAPSULATED_DATA";
11837 const EXTRA_CRC: u8 = 223u8;
11838 const ENCODED_LEN: usize = 255usize;
11839 fn deser(
11840 _version: MavlinkVersion,
11841 __input: &[u8],
11842 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11843 let avail_len = __input.len();
11844 let mut payload_buf = [0; Self::ENCODED_LEN];
11845 let mut buf = if avail_len < Self::ENCODED_LEN {
11846 payload_buf[0..avail_len].copy_from_slice(__input);
11847 Bytes::new(&payload_buf)
11848 } else {
11849 Bytes::new(__input)
11850 };
11851 let mut __struct = Self::default();
11852 __struct.seqnr = buf.get_u16_le()?;
11853 for v in &mut __struct.data {
11854 let val = buf.get_u8()?;
11855 *v = val;
11856 }
11857 Ok(__struct)
11858 }
11859 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11860 let mut __tmp = BytesMut::new(bytes);
11861 #[allow(clippy::absurd_extreme_comparisons)]
11862 #[allow(unused_comparisons)]
11863 if __tmp.remaining() < Self::ENCODED_LEN {
11864 panic!(
11865 "buffer is too small (need {} bytes, but got {})",
11866 Self::ENCODED_LEN,
11867 __tmp.remaining(),
11868 )
11869 }
11870 __tmp.put_u16_le(self.seqnr);
11871 for val in &self.data {
11872 __tmp.put_u8(*val);
11873 }
11874 if matches!(version, MavlinkVersion::V2) {
11875 let len = __tmp.len();
11876 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11877 } else {
11878 __tmp.len()
11879 }
11880 }
11881}
11882#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
11883#[doc = ""]
11884#[doc = "ID: 290"]
11885#[derive(Debug, Clone, PartialEq)]
11886#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11887#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11888#[cfg_attr(feature = "ts", derive(TS))]
11889#[cfg_attr(feature = "ts", ts(export))]
11890pub struct ESC_INFO_DATA {
11891 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11892 pub time_usec: u64,
11893 #[doc = "Number of reported errors by each ESC since boot."]
11894 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11895 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11896 pub error_count: [u32; 4],
11897 #[doc = "Counter of data packets received."]
11898 pub counter: u16,
11899 #[doc = "Bitmap of ESC failure flags."]
11900 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11901 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11902 pub failure_flags: [u16; 4],
11903 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
11904 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11905 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
11906 pub temperature: [i16; 4],
11907 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11908 pub index: u8,
11909 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
11910 pub count: u8,
11911 #[doc = "Connection type protocol for all ESC."]
11912 pub connection_type: EscConnectionType,
11913 #[doc = "Information regarding online/offline status of each ESC."]
11914 pub info: u8,
11915}
11916impl ESC_INFO_DATA {
11917 pub const ENCODED_LEN: usize = 46usize;
11918 pub const DEFAULT: Self = Self {
11919 time_usec: 0_u64,
11920 error_count: [0_u32; 4usize],
11921 counter: 0_u16,
11922 failure_flags: [0_u16; 4usize],
11923 temperature: [0_i16; 4usize],
11924 index: 0_u8,
11925 count: 0_u8,
11926 connection_type: EscConnectionType::DEFAULT,
11927 info: 0_u8,
11928 };
11929 #[cfg(feature = "arbitrary")]
11930 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11931 use arbitrary::{Arbitrary, Unstructured};
11932 let mut buf = [0u8; 1024];
11933 rng.fill_bytes(&mut buf);
11934 let mut unstructured = Unstructured::new(&buf);
11935 Self::arbitrary(&mut unstructured).unwrap_or_default()
11936 }
11937}
11938impl Default for ESC_INFO_DATA {
11939 fn default() -> Self {
11940 Self::DEFAULT.clone()
11941 }
11942}
11943impl MessageData for ESC_INFO_DATA {
11944 type Message = MavMessage;
11945 const ID: u32 = 290u32;
11946 const NAME: &'static str = "ESC_INFO";
11947 const EXTRA_CRC: u8 = 251u8;
11948 const ENCODED_LEN: usize = 46usize;
11949 fn deser(
11950 _version: MavlinkVersion,
11951 __input: &[u8],
11952 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11953 let avail_len = __input.len();
11954 let mut payload_buf = [0; Self::ENCODED_LEN];
11955 let mut buf = if avail_len < Self::ENCODED_LEN {
11956 payload_buf[0..avail_len].copy_from_slice(__input);
11957 Bytes::new(&payload_buf)
11958 } else {
11959 Bytes::new(__input)
11960 };
11961 let mut __struct = Self::default();
11962 __struct.time_usec = buf.get_u64_le()?;
11963 for v in &mut __struct.error_count {
11964 let val = buf.get_u32_le()?;
11965 *v = val;
11966 }
11967 __struct.counter = buf.get_u16_le()?;
11968 for v in &mut __struct.failure_flags {
11969 let val = buf.get_u16_le()?;
11970 *v = val;
11971 }
11972 for v in &mut __struct.temperature {
11973 let val = buf.get_i16_le()?;
11974 *v = val;
11975 }
11976 __struct.index = buf.get_u8()?;
11977 __struct.count = buf.get_u8()?;
11978 let tmp = buf.get_u8()?;
11979 __struct.connection_type =
11980 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11981 enum_type: "EscConnectionType",
11982 value: tmp as u64,
11983 })?;
11984 __struct.info = buf.get_u8()?;
11985 Ok(__struct)
11986 }
11987 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11988 let mut __tmp = BytesMut::new(bytes);
11989 #[allow(clippy::absurd_extreme_comparisons)]
11990 #[allow(unused_comparisons)]
11991 if __tmp.remaining() < Self::ENCODED_LEN {
11992 panic!(
11993 "buffer is too small (need {} bytes, but got {})",
11994 Self::ENCODED_LEN,
11995 __tmp.remaining(),
11996 )
11997 }
11998 __tmp.put_u64_le(self.time_usec);
11999 for val in &self.error_count {
12000 __tmp.put_u32_le(*val);
12001 }
12002 __tmp.put_u16_le(self.counter);
12003 for val in &self.failure_flags {
12004 __tmp.put_u16_le(*val);
12005 }
12006 for val in &self.temperature {
12007 __tmp.put_i16_le(*val);
12008 }
12009 __tmp.put_u8(self.index);
12010 __tmp.put_u8(self.count);
12011 __tmp.put_u8(self.connection_type as u8);
12012 __tmp.put_u8(self.info);
12013 if matches!(version, MavlinkVersion::V2) {
12014 let len = __tmp.len();
12015 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12016 } else {
12017 __tmp.len()
12018 }
12019 }
12020}
12021#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
12022#[doc = ""]
12023#[doc = "ID: 291"]
12024#[derive(Debug, Clone, PartialEq)]
12025#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12026#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12027#[cfg_attr(feature = "ts", derive(TS))]
12028#[cfg_attr(feature = "ts", ts(export))]
12029pub struct ESC_STATUS_DATA {
12030 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
12031 pub time_usec: u64,
12032 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
12033 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12034 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12035 pub rpm: [i32; 4],
12036 #[doc = "Voltage measured from each ESC."]
12037 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12038 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12039 pub voltage: [f32; 4],
12040 #[doc = "Current measured from each ESC."]
12041 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12042 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12043 pub current: [f32; 4],
12044 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
12045 pub index: u8,
12046}
12047impl ESC_STATUS_DATA {
12048 pub const ENCODED_LEN: usize = 57usize;
12049 pub const DEFAULT: Self = Self {
12050 time_usec: 0_u64,
12051 rpm: [0_i32; 4usize],
12052 voltage: [0.0_f32; 4usize],
12053 current: [0.0_f32; 4usize],
12054 index: 0_u8,
12055 };
12056 #[cfg(feature = "arbitrary")]
12057 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12058 use arbitrary::{Arbitrary, Unstructured};
12059 let mut buf = [0u8; 1024];
12060 rng.fill_bytes(&mut buf);
12061 let mut unstructured = Unstructured::new(&buf);
12062 Self::arbitrary(&mut unstructured).unwrap_or_default()
12063 }
12064}
12065impl Default for ESC_STATUS_DATA {
12066 fn default() -> Self {
12067 Self::DEFAULT.clone()
12068 }
12069}
12070impl MessageData for ESC_STATUS_DATA {
12071 type Message = MavMessage;
12072 const ID: u32 = 291u32;
12073 const NAME: &'static str = "ESC_STATUS";
12074 const EXTRA_CRC: u8 = 10u8;
12075 const ENCODED_LEN: usize = 57usize;
12076 fn deser(
12077 _version: MavlinkVersion,
12078 __input: &[u8],
12079 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12080 let avail_len = __input.len();
12081 let mut payload_buf = [0; Self::ENCODED_LEN];
12082 let mut buf = if avail_len < Self::ENCODED_LEN {
12083 payload_buf[0..avail_len].copy_from_slice(__input);
12084 Bytes::new(&payload_buf)
12085 } else {
12086 Bytes::new(__input)
12087 };
12088 let mut __struct = Self::default();
12089 __struct.time_usec = buf.get_u64_le()?;
12090 for v in &mut __struct.rpm {
12091 let val = buf.get_i32_le()?;
12092 *v = val;
12093 }
12094 for v in &mut __struct.voltage {
12095 let val = buf.get_f32_le()?;
12096 *v = val;
12097 }
12098 for v in &mut __struct.current {
12099 let val = buf.get_f32_le()?;
12100 *v = val;
12101 }
12102 __struct.index = buf.get_u8()?;
12103 Ok(__struct)
12104 }
12105 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12106 let mut __tmp = BytesMut::new(bytes);
12107 #[allow(clippy::absurd_extreme_comparisons)]
12108 #[allow(unused_comparisons)]
12109 if __tmp.remaining() < Self::ENCODED_LEN {
12110 panic!(
12111 "buffer is too small (need {} bytes, but got {})",
12112 Self::ENCODED_LEN,
12113 __tmp.remaining(),
12114 )
12115 }
12116 __tmp.put_u64_le(self.time_usec);
12117 for val in &self.rpm {
12118 __tmp.put_i32_le(*val);
12119 }
12120 for val in &self.voltage {
12121 __tmp.put_f32_le(*val);
12122 }
12123 for val in &self.current {
12124 __tmp.put_f32_le(*val);
12125 }
12126 __tmp.put_u8(self.index);
12127 if matches!(version, MavlinkVersion::V2) {
12128 let len = __tmp.len();
12129 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12130 } else {
12131 __tmp.len()
12132 }
12133 }
12134}
12135#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
12136#[doc = ""]
12137#[doc = "ID: 230"]
12138#[derive(Debug, Clone, PartialEq)]
12139#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12140#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12141#[cfg_attr(feature = "ts", derive(TS))]
12142#[cfg_attr(feature = "ts", ts(export))]
12143pub struct ESTIMATOR_STATUS_DATA {
12144 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
12145 pub time_usec: u64,
12146 #[doc = "Velocity innovation test ratio"]
12147 pub vel_ratio: f32,
12148 #[doc = "Horizontal position innovation test ratio"]
12149 pub pos_horiz_ratio: f32,
12150 #[doc = "Vertical position innovation test ratio"]
12151 pub pos_vert_ratio: f32,
12152 #[doc = "Magnetometer innovation test ratio"]
12153 pub mag_ratio: f32,
12154 #[doc = "Height above terrain innovation test ratio"]
12155 pub hagl_ratio: f32,
12156 #[doc = "True airspeed innovation test ratio"]
12157 pub tas_ratio: f32,
12158 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
12159 pub pos_horiz_accuracy: f32,
12160 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
12161 pub pos_vert_accuracy: f32,
12162 #[doc = "Bitmap indicating which EKF outputs are valid."]
12163 pub flags: EstimatorStatusFlags,
12164}
12165impl ESTIMATOR_STATUS_DATA {
12166 pub const ENCODED_LEN: usize = 42usize;
12167 pub const DEFAULT: Self = Self {
12168 time_usec: 0_u64,
12169 vel_ratio: 0.0_f32,
12170 pos_horiz_ratio: 0.0_f32,
12171 pos_vert_ratio: 0.0_f32,
12172 mag_ratio: 0.0_f32,
12173 hagl_ratio: 0.0_f32,
12174 tas_ratio: 0.0_f32,
12175 pos_horiz_accuracy: 0.0_f32,
12176 pos_vert_accuracy: 0.0_f32,
12177 flags: EstimatorStatusFlags::DEFAULT,
12178 };
12179 #[cfg(feature = "arbitrary")]
12180 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12181 use arbitrary::{Arbitrary, Unstructured};
12182 let mut buf = [0u8; 1024];
12183 rng.fill_bytes(&mut buf);
12184 let mut unstructured = Unstructured::new(&buf);
12185 Self::arbitrary(&mut unstructured).unwrap_or_default()
12186 }
12187}
12188impl Default for ESTIMATOR_STATUS_DATA {
12189 fn default() -> Self {
12190 Self::DEFAULT.clone()
12191 }
12192}
12193impl MessageData for ESTIMATOR_STATUS_DATA {
12194 type Message = MavMessage;
12195 const ID: u32 = 230u32;
12196 const NAME: &'static str = "ESTIMATOR_STATUS";
12197 const EXTRA_CRC: u8 = 163u8;
12198 const ENCODED_LEN: usize = 42usize;
12199 fn deser(
12200 _version: MavlinkVersion,
12201 __input: &[u8],
12202 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12203 let avail_len = __input.len();
12204 let mut payload_buf = [0; Self::ENCODED_LEN];
12205 let mut buf = if avail_len < Self::ENCODED_LEN {
12206 payload_buf[0..avail_len].copy_from_slice(__input);
12207 Bytes::new(&payload_buf)
12208 } else {
12209 Bytes::new(__input)
12210 };
12211 let mut __struct = Self::default();
12212 __struct.time_usec = buf.get_u64_le()?;
12213 __struct.vel_ratio = buf.get_f32_le()?;
12214 __struct.pos_horiz_ratio = buf.get_f32_le()?;
12215 __struct.pos_vert_ratio = buf.get_f32_le()?;
12216 __struct.mag_ratio = buf.get_f32_le()?;
12217 __struct.hagl_ratio = buf.get_f32_le()?;
12218 __struct.tas_ratio = buf.get_f32_le()?;
12219 __struct.pos_horiz_accuracy = buf.get_f32_le()?;
12220 __struct.pos_vert_accuracy = buf.get_f32_le()?;
12221 let tmp = buf.get_u16_le()?;
12222 __struct.flags = EstimatorStatusFlags::from_bits(
12223 tmp as <EstimatorStatusFlags as Flags>::Bits,
12224 )
12225 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12226 flag_type: "EstimatorStatusFlags",
12227 value: tmp as u64,
12228 })?;
12229 Ok(__struct)
12230 }
12231 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12232 let mut __tmp = BytesMut::new(bytes);
12233 #[allow(clippy::absurd_extreme_comparisons)]
12234 #[allow(unused_comparisons)]
12235 if __tmp.remaining() < Self::ENCODED_LEN {
12236 panic!(
12237 "buffer is too small (need {} bytes, but got {})",
12238 Self::ENCODED_LEN,
12239 __tmp.remaining(),
12240 )
12241 }
12242 __tmp.put_u64_le(self.time_usec);
12243 __tmp.put_f32_le(self.vel_ratio);
12244 __tmp.put_f32_le(self.pos_horiz_ratio);
12245 __tmp.put_f32_le(self.pos_vert_ratio);
12246 __tmp.put_f32_le(self.mag_ratio);
12247 __tmp.put_f32_le(self.hagl_ratio);
12248 __tmp.put_f32_le(self.tas_ratio);
12249 __tmp.put_f32_le(self.pos_horiz_accuracy);
12250 __tmp.put_f32_le(self.pos_vert_accuracy);
12251 __tmp.put_u16_le(self.flags.bits() as u16);
12252 if matches!(version, MavlinkVersion::V2) {
12253 let len = __tmp.len();
12254 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12255 } else {
12256 __tmp.len()
12257 }
12258 }
12259}
12260#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
12261#[doc = ""]
12262#[doc = "ID: 410"]
12263#[derive(Debug, Clone, PartialEq)]
12264#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12265#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12266#[cfg_attr(feature = "ts", derive(TS))]
12267#[cfg_attr(feature = "ts", ts(export))]
12268pub struct EVENT_DATA {
12269 #[doc = "Event ID (as defined in the component metadata)"]
12270 pub id: u32,
12271 #[doc = "Timestamp (time since system boot when the event happened)."]
12272 pub event_time_boot_ms: u32,
12273 #[doc = "Sequence number."]
12274 pub sequence: u16,
12275 #[doc = "Component ID"]
12276 pub destination_component: u8,
12277 #[doc = "System ID"]
12278 pub destination_system: u8,
12279 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
12280 pub log_levels: u8,
12281 #[doc = "Arguments (depend on event ID)."]
12282 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12283 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12284 pub arguments: [u8; 40],
12285}
12286impl EVENT_DATA {
12287 pub const ENCODED_LEN: usize = 53usize;
12288 pub const DEFAULT: Self = Self {
12289 id: 0_u32,
12290 event_time_boot_ms: 0_u32,
12291 sequence: 0_u16,
12292 destination_component: 0_u8,
12293 destination_system: 0_u8,
12294 log_levels: 0_u8,
12295 arguments: [0_u8; 40usize],
12296 };
12297 #[cfg(feature = "arbitrary")]
12298 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12299 use arbitrary::{Arbitrary, Unstructured};
12300 let mut buf = [0u8; 1024];
12301 rng.fill_bytes(&mut buf);
12302 let mut unstructured = Unstructured::new(&buf);
12303 Self::arbitrary(&mut unstructured).unwrap_or_default()
12304 }
12305}
12306impl Default for EVENT_DATA {
12307 fn default() -> Self {
12308 Self::DEFAULT.clone()
12309 }
12310}
12311impl MessageData for EVENT_DATA {
12312 type Message = MavMessage;
12313 const ID: u32 = 410u32;
12314 const NAME: &'static str = "EVENT";
12315 const EXTRA_CRC: u8 = 160u8;
12316 const ENCODED_LEN: usize = 53usize;
12317 fn deser(
12318 _version: MavlinkVersion,
12319 __input: &[u8],
12320 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12321 let avail_len = __input.len();
12322 let mut payload_buf = [0; Self::ENCODED_LEN];
12323 let mut buf = if avail_len < Self::ENCODED_LEN {
12324 payload_buf[0..avail_len].copy_from_slice(__input);
12325 Bytes::new(&payload_buf)
12326 } else {
12327 Bytes::new(__input)
12328 };
12329 let mut __struct = Self::default();
12330 __struct.id = buf.get_u32_le()?;
12331 __struct.event_time_boot_ms = buf.get_u32_le()?;
12332 __struct.sequence = buf.get_u16_le()?;
12333 __struct.destination_component = buf.get_u8()?;
12334 __struct.destination_system = buf.get_u8()?;
12335 __struct.log_levels = buf.get_u8()?;
12336 for v in &mut __struct.arguments {
12337 let val = buf.get_u8()?;
12338 *v = val;
12339 }
12340 Ok(__struct)
12341 }
12342 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12343 let mut __tmp = BytesMut::new(bytes);
12344 #[allow(clippy::absurd_extreme_comparisons)]
12345 #[allow(unused_comparisons)]
12346 if __tmp.remaining() < Self::ENCODED_LEN {
12347 panic!(
12348 "buffer is too small (need {} bytes, but got {})",
12349 Self::ENCODED_LEN,
12350 __tmp.remaining(),
12351 )
12352 }
12353 __tmp.put_u32_le(self.id);
12354 __tmp.put_u32_le(self.event_time_boot_ms);
12355 __tmp.put_u16_le(self.sequence);
12356 __tmp.put_u8(self.destination_component);
12357 __tmp.put_u8(self.destination_system);
12358 __tmp.put_u8(self.log_levels);
12359 for val in &self.arguments {
12360 __tmp.put_u8(*val);
12361 }
12362 if matches!(version, MavlinkVersion::V2) {
12363 let len = __tmp.len();
12364 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12365 } else {
12366 __tmp.len()
12367 }
12368 }
12369}
12370#[doc = "Provides state for additional features."]
12371#[doc = ""]
12372#[doc = "ID: 245"]
12373#[derive(Debug, Clone, PartialEq)]
12374#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12375#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12376#[cfg_attr(feature = "ts", derive(TS))]
12377#[cfg_attr(feature = "ts", ts(export))]
12378pub struct EXTENDED_SYS_STATE_DATA {
12379 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
12380 pub vtol_state: MavVtolState,
12381 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
12382 pub landed_state: MavLandedState,
12383}
12384impl EXTENDED_SYS_STATE_DATA {
12385 pub const ENCODED_LEN: usize = 2usize;
12386 pub const DEFAULT: Self = Self {
12387 vtol_state: MavVtolState::DEFAULT,
12388 landed_state: MavLandedState::DEFAULT,
12389 };
12390 #[cfg(feature = "arbitrary")]
12391 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12392 use arbitrary::{Arbitrary, Unstructured};
12393 let mut buf = [0u8; 1024];
12394 rng.fill_bytes(&mut buf);
12395 let mut unstructured = Unstructured::new(&buf);
12396 Self::arbitrary(&mut unstructured).unwrap_or_default()
12397 }
12398}
12399impl Default for EXTENDED_SYS_STATE_DATA {
12400 fn default() -> Self {
12401 Self::DEFAULT.clone()
12402 }
12403}
12404impl MessageData for EXTENDED_SYS_STATE_DATA {
12405 type Message = MavMessage;
12406 const ID: u32 = 245u32;
12407 const NAME: &'static str = "EXTENDED_SYS_STATE";
12408 const EXTRA_CRC: u8 = 130u8;
12409 const ENCODED_LEN: usize = 2usize;
12410 fn deser(
12411 _version: MavlinkVersion,
12412 __input: &[u8],
12413 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12414 let avail_len = __input.len();
12415 let mut payload_buf = [0; Self::ENCODED_LEN];
12416 let mut buf = if avail_len < Self::ENCODED_LEN {
12417 payload_buf[0..avail_len].copy_from_slice(__input);
12418 Bytes::new(&payload_buf)
12419 } else {
12420 Bytes::new(__input)
12421 };
12422 let mut __struct = Self::default();
12423 let tmp = buf.get_u8()?;
12424 __struct.vtol_state =
12425 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12426 enum_type: "MavVtolState",
12427 value: tmp as u64,
12428 })?;
12429 let tmp = buf.get_u8()?;
12430 __struct.landed_state =
12431 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12432 enum_type: "MavLandedState",
12433 value: tmp as u64,
12434 })?;
12435 Ok(__struct)
12436 }
12437 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12438 let mut __tmp = BytesMut::new(bytes);
12439 #[allow(clippy::absurd_extreme_comparisons)]
12440 #[allow(unused_comparisons)]
12441 if __tmp.remaining() < Self::ENCODED_LEN {
12442 panic!(
12443 "buffer is too small (need {} bytes, but got {})",
12444 Self::ENCODED_LEN,
12445 __tmp.remaining(),
12446 )
12447 }
12448 __tmp.put_u8(self.vtol_state as u8);
12449 __tmp.put_u8(self.landed_state as u8);
12450 if matches!(version, MavlinkVersion::V2) {
12451 let len = __tmp.len();
12452 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12453 } else {
12454 __tmp.len()
12455 }
12456 }
12457}
12458#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
12459#[doc = ""]
12460#[doc = "ID: 162"]
12461#[derive(Debug, Clone, PartialEq)]
12462#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12463#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12464#[cfg_attr(feature = "ts", derive(TS))]
12465#[cfg_attr(feature = "ts", ts(export))]
12466pub struct FENCE_STATUS_DATA {
12467 #[doc = "Time (since boot) of last breach."]
12468 pub breach_time: u32,
12469 #[doc = "Number of fence breaches."]
12470 pub breach_count: u16,
12471 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
12472 pub breach_status: u8,
12473 #[doc = "Last breach type."]
12474 pub breach_type: FenceBreach,
12475 #[doc = "Active action to prevent fence breach"]
12476 #[cfg_attr(feature = "serde", serde(default))]
12477 pub breach_mitigation: FenceMitigate,
12478}
12479impl FENCE_STATUS_DATA {
12480 pub const ENCODED_LEN: usize = 9usize;
12481 pub const DEFAULT: Self = Self {
12482 breach_time: 0_u32,
12483 breach_count: 0_u16,
12484 breach_status: 0_u8,
12485 breach_type: FenceBreach::DEFAULT,
12486 breach_mitigation: FenceMitigate::DEFAULT,
12487 };
12488 #[cfg(feature = "arbitrary")]
12489 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12490 use arbitrary::{Arbitrary, Unstructured};
12491 let mut buf = [0u8; 1024];
12492 rng.fill_bytes(&mut buf);
12493 let mut unstructured = Unstructured::new(&buf);
12494 Self::arbitrary(&mut unstructured).unwrap_or_default()
12495 }
12496}
12497impl Default for FENCE_STATUS_DATA {
12498 fn default() -> Self {
12499 Self::DEFAULT.clone()
12500 }
12501}
12502impl MessageData for FENCE_STATUS_DATA {
12503 type Message = MavMessage;
12504 const ID: u32 = 162u32;
12505 const NAME: &'static str = "FENCE_STATUS";
12506 const EXTRA_CRC: u8 = 189u8;
12507 const ENCODED_LEN: usize = 9usize;
12508 fn deser(
12509 _version: MavlinkVersion,
12510 __input: &[u8],
12511 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12512 let avail_len = __input.len();
12513 let mut payload_buf = [0; Self::ENCODED_LEN];
12514 let mut buf = if avail_len < Self::ENCODED_LEN {
12515 payload_buf[0..avail_len].copy_from_slice(__input);
12516 Bytes::new(&payload_buf)
12517 } else {
12518 Bytes::new(__input)
12519 };
12520 let mut __struct = Self::default();
12521 __struct.breach_time = buf.get_u32_le()?;
12522 __struct.breach_count = buf.get_u16_le()?;
12523 __struct.breach_status = buf.get_u8()?;
12524 let tmp = buf.get_u8()?;
12525 __struct.breach_type =
12526 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12527 enum_type: "FenceBreach",
12528 value: tmp as u64,
12529 })?;
12530 let tmp = buf.get_u8()?;
12531 __struct.breach_mitigation =
12532 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12533 enum_type: "FenceMitigate",
12534 value: tmp as u64,
12535 })?;
12536 Ok(__struct)
12537 }
12538 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12539 let mut __tmp = BytesMut::new(bytes);
12540 #[allow(clippy::absurd_extreme_comparisons)]
12541 #[allow(unused_comparisons)]
12542 if __tmp.remaining() < Self::ENCODED_LEN {
12543 panic!(
12544 "buffer is too small (need {} bytes, but got {})",
12545 Self::ENCODED_LEN,
12546 __tmp.remaining(),
12547 )
12548 }
12549 __tmp.put_u32_le(self.breach_time);
12550 __tmp.put_u16_le(self.breach_count);
12551 __tmp.put_u8(self.breach_status);
12552 __tmp.put_u8(self.breach_type as u8);
12553 if matches!(version, MavlinkVersion::V2) {
12554 __tmp.put_u8(self.breach_mitigation as u8);
12555 let len = __tmp.len();
12556 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12557 } else {
12558 __tmp.len()
12559 }
12560 }
12561}
12562#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
12563#[doc = ""]
12564#[doc = "ID: 110"]
12565#[derive(Debug, Clone, PartialEq)]
12566#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12567#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12568#[cfg_attr(feature = "ts", derive(TS))]
12569#[cfg_attr(feature = "ts", ts(export))]
12570pub struct FILE_TRANSFER_PROTOCOL_DATA {
12571 #[doc = "Network ID (0 for broadcast)"]
12572 pub target_network: u8,
12573 #[doc = "System ID (0 for broadcast)"]
12574 pub target_system: u8,
12575 #[doc = "Component ID (0 for broadcast)"]
12576 pub target_component: u8,
12577 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
12578 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12579 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12580 pub payload: [u8; 251],
12581}
12582impl FILE_TRANSFER_PROTOCOL_DATA {
12583 pub const ENCODED_LEN: usize = 254usize;
12584 pub const DEFAULT: Self = Self {
12585 target_network: 0_u8,
12586 target_system: 0_u8,
12587 target_component: 0_u8,
12588 payload: [0_u8; 251usize],
12589 };
12590 #[cfg(feature = "arbitrary")]
12591 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12592 use arbitrary::{Arbitrary, Unstructured};
12593 let mut buf = [0u8; 1024];
12594 rng.fill_bytes(&mut buf);
12595 let mut unstructured = Unstructured::new(&buf);
12596 Self::arbitrary(&mut unstructured).unwrap_or_default()
12597 }
12598}
12599impl Default for FILE_TRANSFER_PROTOCOL_DATA {
12600 fn default() -> Self {
12601 Self::DEFAULT.clone()
12602 }
12603}
12604impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
12605 type Message = MavMessage;
12606 const ID: u32 = 110u32;
12607 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
12608 const EXTRA_CRC: u8 = 84u8;
12609 const ENCODED_LEN: usize = 254usize;
12610 fn deser(
12611 _version: MavlinkVersion,
12612 __input: &[u8],
12613 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12614 let avail_len = __input.len();
12615 let mut payload_buf = [0; Self::ENCODED_LEN];
12616 let mut buf = if avail_len < Self::ENCODED_LEN {
12617 payload_buf[0..avail_len].copy_from_slice(__input);
12618 Bytes::new(&payload_buf)
12619 } else {
12620 Bytes::new(__input)
12621 };
12622 let mut __struct = Self::default();
12623 __struct.target_network = buf.get_u8()?;
12624 __struct.target_system = buf.get_u8()?;
12625 __struct.target_component = buf.get_u8()?;
12626 for v in &mut __struct.payload {
12627 let val = buf.get_u8()?;
12628 *v = val;
12629 }
12630 Ok(__struct)
12631 }
12632 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12633 let mut __tmp = BytesMut::new(bytes);
12634 #[allow(clippy::absurd_extreme_comparisons)]
12635 #[allow(unused_comparisons)]
12636 if __tmp.remaining() < Self::ENCODED_LEN {
12637 panic!(
12638 "buffer is too small (need {} bytes, but got {})",
12639 Self::ENCODED_LEN,
12640 __tmp.remaining(),
12641 )
12642 }
12643 __tmp.put_u8(self.target_network);
12644 __tmp.put_u8(self.target_system);
12645 __tmp.put_u8(self.target_component);
12646 for val in &self.payload {
12647 __tmp.put_u8(*val);
12648 }
12649 if matches!(version, MavlinkVersion::V2) {
12650 let len = __tmp.len();
12651 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12652 } else {
12653 __tmp.len()
12654 }
12655 }
12656}
12657#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
12658#[doc = ""]
12659#[doc = "ID: 264"]
12660#[derive(Debug, Clone, PartialEq)]
12661#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12662#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12663#[cfg_attr(feature = "ts", derive(TS))]
12664#[cfg_attr(feature = "ts", ts(export))]
12665pub struct FLIGHT_INFORMATION_DATA {
12666 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
12667 pub arming_time_utc: u64,
12668 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
12669 pub takeoff_time_utc: u64,
12670 #[doc = "Flight number. Note, field is misnamed UUID."]
12671 pub flight_uuid: u64,
12672 #[doc = "Timestamp (time since system boot)."]
12673 pub time_boot_ms: u32,
12674 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
12675 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12676 pub landing_time: u32,
12677}
12678impl FLIGHT_INFORMATION_DATA {
12679 pub const ENCODED_LEN: usize = 32usize;
12680 pub const DEFAULT: Self = Self {
12681 arming_time_utc: 0_u64,
12682 takeoff_time_utc: 0_u64,
12683 flight_uuid: 0_u64,
12684 time_boot_ms: 0_u32,
12685 landing_time: 0_u32,
12686 };
12687 #[cfg(feature = "arbitrary")]
12688 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12689 use arbitrary::{Arbitrary, Unstructured};
12690 let mut buf = [0u8; 1024];
12691 rng.fill_bytes(&mut buf);
12692 let mut unstructured = Unstructured::new(&buf);
12693 Self::arbitrary(&mut unstructured).unwrap_or_default()
12694 }
12695}
12696impl Default for FLIGHT_INFORMATION_DATA {
12697 fn default() -> Self {
12698 Self::DEFAULT.clone()
12699 }
12700}
12701impl MessageData for FLIGHT_INFORMATION_DATA {
12702 type Message = MavMessage;
12703 const ID: u32 = 264u32;
12704 const NAME: &'static str = "FLIGHT_INFORMATION";
12705 const EXTRA_CRC: u8 = 49u8;
12706 const ENCODED_LEN: usize = 32usize;
12707 fn deser(
12708 _version: MavlinkVersion,
12709 __input: &[u8],
12710 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12711 let avail_len = __input.len();
12712 let mut payload_buf = [0; Self::ENCODED_LEN];
12713 let mut buf = if avail_len < Self::ENCODED_LEN {
12714 payload_buf[0..avail_len].copy_from_slice(__input);
12715 Bytes::new(&payload_buf)
12716 } else {
12717 Bytes::new(__input)
12718 };
12719 let mut __struct = Self::default();
12720 __struct.arming_time_utc = buf.get_u64_le()?;
12721 __struct.takeoff_time_utc = buf.get_u64_le()?;
12722 __struct.flight_uuid = buf.get_u64_le()?;
12723 __struct.time_boot_ms = buf.get_u32_le()?;
12724 __struct.landing_time = buf.get_u32_le()?;
12725 Ok(__struct)
12726 }
12727 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12728 let mut __tmp = BytesMut::new(bytes);
12729 #[allow(clippy::absurd_extreme_comparisons)]
12730 #[allow(unused_comparisons)]
12731 if __tmp.remaining() < Self::ENCODED_LEN {
12732 panic!(
12733 "buffer is too small (need {} bytes, but got {})",
12734 Self::ENCODED_LEN,
12735 __tmp.remaining(),
12736 )
12737 }
12738 __tmp.put_u64_le(self.arming_time_utc);
12739 __tmp.put_u64_le(self.takeoff_time_utc);
12740 __tmp.put_u64_le(self.flight_uuid);
12741 __tmp.put_u32_le(self.time_boot_ms);
12742 if matches!(version, MavlinkVersion::V2) {
12743 __tmp.put_u32_le(self.landing_time);
12744 let len = __tmp.len();
12745 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12746 } else {
12747 __tmp.len()
12748 }
12749 }
12750}
12751#[doc = "Current motion information from a designated system."]
12752#[doc = ""]
12753#[doc = "ID: 144"]
12754#[derive(Debug, Clone, PartialEq)]
12755#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12756#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12757#[cfg_attr(feature = "ts", derive(TS))]
12758#[cfg_attr(feature = "ts", ts(export))]
12759pub struct FOLLOW_TARGET_DATA {
12760 #[doc = "Timestamp (time since system boot)."]
12761 pub timestamp: u64,
12762 #[doc = "button states or switches of a tracker device"]
12763 pub custom_state: u64,
12764 #[doc = "Latitude (WGS84)"]
12765 pub lat: i32,
12766 #[doc = "Longitude (WGS84)"]
12767 pub lon: i32,
12768 #[doc = "Altitude (MSL)"]
12769 pub alt: f32,
12770 #[doc = "target velocity (0,0,0) for unknown"]
12771 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12772 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12773 pub vel: [f32; 3],
12774 #[doc = "linear target acceleration (0,0,0) for unknown"]
12775 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12776 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12777 pub acc: [f32; 3],
12778 #[doc = "(0 0 0 0 for unknown)"]
12779 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12780 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12781 pub attitude_q: [f32; 4],
12782 #[doc = "(0 0 0 for unknown)"]
12783 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12784 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12785 pub rates: [f32; 3],
12786 #[doc = "eph epv"]
12787 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12788 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
12789 pub position_cov: [f32; 3],
12790 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
12791 pub est_capabilities: u8,
12792}
12793impl FOLLOW_TARGET_DATA {
12794 pub const ENCODED_LEN: usize = 93usize;
12795 pub const DEFAULT: Self = Self {
12796 timestamp: 0_u64,
12797 custom_state: 0_u64,
12798 lat: 0_i32,
12799 lon: 0_i32,
12800 alt: 0.0_f32,
12801 vel: [0.0_f32; 3usize],
12802 acc: [0.0_f32; 3usize],
12803 attitude_q: [0.0_f32; 4usize],
12804 rates: [0.0_f32; 3usize],
12805 position_cov: [0.0_f32; 3usize],
12806 est_capabilities: 0_u8,
12807 };
12808 #[cfg(feature = "arbitrary")]
12809 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12810 use arbitrary::{Arbitrary, Unstructured};
12811 let mut buf = [0u8; 1024];
12812 rng.fill_bytes(&mut buf);
12813 let mut unstructured = Unstructured::new(&buf);
12814 Self::arbitrary(&mut unstructured).unwrap_or_default()
12815 }
12816}
12817impl Default for FOLLOW_TARGET_DATA {
12818 fn default() -> Self {
12819 Self::DEFAULT.clone()
12820 }
12821}
12822impl MessageData for FOLLOW_TARGET_DATA {
12823 type Message = MavMessage;
12824 const ID: u32 = 144u32;
12825 const NAME: &'static str = "FOLLOW_TARGET";
12826 const EXTRA_CRC: u8 = 127u8;
12827 const ENCODED_LEN: usize = 93usize;
12828 fn deser(
12829 _version: MavlinkVersion,
12830 __input: &[u8],
12831 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12832 let avail_len = __input.len();
12833 let mut payload_buf = [0; Self::ENCODED_LEN];
12834 let mut buf = if avail_len < Self::ENCODED_LEN {
12835 payload_buf[0..avail_len].copy_from_slice(__input);
12836 Bytes::new(&payload_buf)
12837 } else {
12838 Bytes::new(__input)
12839 };
12840 let mut __struct = Self::default();
12841 __struct.timestamp = buf.get_u64_le()?;
12842 __struct.custom_state = buf.get_u64_le()?;
12843 __struct.lat = buf.get_i32_le()?;
12844 __struct.lon = buf.get_i32_le()?;
12845 __struct.alt = buf.get_f32_le()?;
12846 for v in &mut __struct.vel {
12847 let val = buf.get_f32_le()?;
12848 *v = val;
12849 }
12850 for v in &mut __struct.acc {
12851 let val = buf.get_f32_le()?;
12852 *v = val;
12853 }
12854 for v in &mut __struct.attitude_q {
12855 let val = buf.get_f32_le()?;
12856 *v = val;
12857 }
12858 for v in &mut __struct.rates {
12859 let val = buf.get_f32_le()?;
12860 *v = val;
12861 }
12862 for v in &mut __struct.position_cov {
12863 let val = buf.get_f32_le()?;
12864 *v = val;
12865 }
12866 __struct.est_capabilities = buf.get_u8()?;
12867 Ok(__struct)
12868 }
12869 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12870 let mut __tmp = BytesMut::new(bytes);
12871 #[allow(clippy::absurd_extreme_comparisons)]
12872 #[allow(unused_comparisons)]
12873 if __tmp.remaining() < Self::ENCODED_LEN {
12874 panic!(
12875 "buffer is too small (need {} bytes, but got {})",
12876 Self::ENCODED_LEN,
12877 __tmp.remaining(),
12878 )
12879 }
12880 __tmp.put_u64_le(self.timestamp);
12881 __tmp.put_u64_le(self.custom_state);
12882 __tmp.put_i32_le(self.lat);
12883 __tmp.put_i32_le(self.lon);
12884 __tmp.put_f32_le(self.alt);
12885 for val in &self.vel {
12886 __tmp.put_f32_le(*val);
12887 }
12888 for val in &self.acc {
12889 __tmp.put_f32_le(*val);
12890 }
12891 for val in &self.attitude_q {
12892 __tmp.put_f32_le(*val);
12893 }
12894 for val in &self.rates {
12895 __tmp.put_f32_le(*val);
12896 }
12897 for val in &self.position_cov {
12898 __tmp.put_f32_le(*val);
12899 }
12900 __tmp.put_u8(self.est_capabilities);
12901 if matches!(version, MavlinkVersion::V2) {
12902 let len = __tmp.len();
12903 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12904 } else {
12905 __tmp.len()
12906 }
12907 }
12908}
12909#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
12910#[doc = ""]
12911#[doc = "ID: 371"]
12912#[derive(Debug, Clone, PartialEq)]
12913#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12914#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12915#[cfg_attr(feature = "ts", derive(TS))]
12916#[cfg_attr(feature = "ts", ts(export))]
12917pub struct FUEL_STATUS_DATA {
12918 #[doc = "Capacity when full. Must be provided."]
12919 pub maximum_fuel: f32,
12920 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12921 pub consumed_fuel: f32,
12922 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12923 pub remaining_fuel: f32,
12924 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
12925 pub flow_rate: f32,
12926 #[doc = "Fuel temperature. NaN: field not provided."]
12927 pub temperature: f32,
12928 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
12929 pub fuel_type: MavFuelType,
12930 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
12931 pub id: u8,
12932 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
12933 pub percent_remaining: u8,
12934}
12935impl FUEL_STATUS_DATA {
12936 pub const ENCODED_LEN: usize = 26usize;
12937 pub const DEFAULT: Self = Self {
12938 maximum_fuel: 0.0_f32,
12939 consumed_fuel: 0.0_f32,
12940 remaining_fuel: 0.0_f32,
12941 flow_rate: 0.0_f32,
12942 temperature: 0.0_f32,
12943 fuel_type: MavFuelType::DEFAULT,
12944 id: 0_u8,
12945 percent_remaining: 0_u8,
12946 };
12947 #[cfg(feature = "arbitrary")]
12948 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12949 use arbitrary::{Arbitrary, Unstructured};
12950 let mut buf = [0u8; 1024];
12951 rng.fill_bytes(&mut buf);
12952 let mut unstructured = Unstructured::new(&buf);
12953 Self::arbitrary(&mut unstructured).unwrap_or_default()
12954 }
12955}
12956impl Default for FUEL_STATUS_DATA {
12957 fn default() -> Self {
12958 Self::DEFAULT.clone()
12959 }
12960}
12961impl MessageData for FUEL_STATUS_DATA {
12962 type Message = MavMessage;
12963 const ID: u32 = 371u32;
12964 const NAME: &'static str = "FUEL_STATUS";
12965 const EXTRA_CRC: u8 = 10u8;
12966 const ENCODED_LEN: usize = 26usize;
12967 fn deser(
12968 _version: MavlinkVersion,
12969 __input: &[u8],
12970 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12971 let avail_len = __input.len();
12972 let mut payload_buf = [0; Self::ENCODED_LEN];
12973 let mut buf = if avail_len < Self::ENCODED_LEN {
12974 payload_buf[0..avail_len].copy_from_slice(__input);
12975 Bytes::new(&payload_buf)
12976 } else {
12977 Bytes::new(__input)
12978 };
12979 let mut __struct = Self::default();
12980 __struct.maximum_fuel = buf.get_f32_le()?;
12981 __struct.consumed_fuel = buf.get_f32_le()?;
12982 __struct.remaining_fuel = buf.get_f32_le()?;
12983 __struct.flow_rate = buf.get_f32_le()?;
12984 __struct.temperature = buf.get_f32_le()?;
12985 let tmp = buf.get_u32_le()?;
12986 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
12987 ::mavlink_core::error::ParserError::InvalidEnum {
12988 enum_type: "MavFuelType",
12989 value: tmp as u64,
12990 },
12991 )?;
12992 __struct.id = buf.get_u8()?;
12993 __struct.percent_remaining = buf.get_u8()?;
12994 Ok(__struct)
12995 }
12996 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12997 let mut __tmp = BytesMut::new(bytes);
12998 #[allow(clippy::absurd_extreme_comparisons)]
12999 #[allow(unused_comparisons)]
13000 if __tmp.remaining() < Self::ENCODED_LEN {
13001 panic!(
13002 "buffer is too small (need {} bytes, but got {})",
13003 Self::ENCODED_LEN,
13004 __tmp.remaining(),
13005 )
13006 }
13007 __tmp.put_f32_le(self.maximum_fuel);
13008 __tmp.put_f32_le(self.consumed_fuel);
13009 __tmp.put_f32_le(self.remaining_fuel);
13010 __tmp.put_f32_le(self.flow_rate);
13011 __tmp.put_f32_le(self.temperature);
13012 __tmp.put_u32_le(self.fuel_type as u32);
13013 __tmp.put_u8(self.id);
13014 __tmp.put_u8(self.percent_remaining);
13015 if matches!(version, MavlinkVersion::V2) {
13016 let len = __tmp.len();
13017 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13018 } else {
13019 __tmp.len()
13020 }
13021 }
13022}
13023#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
13024#[doc = ""]
13025#[doc = "ID: 373"]
13026#[derive(Debug, Clone, PartialEq)]
13027#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13028#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13029#[cfg_attr(feature = "ts", derive(TS))]
13030#[cfg_attr(feature = "ts", ts(export))]
13031pub struct GENERATOR_STATUS_DATA {
13032 #[doc = "Status flags."]
13033 pub status: MavGeneratorStatusFlag,
13034 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
13035 pub battery_current: f32,
13036 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
13037 pub load_current: f32,
13038 #[doc = "The power being generated. NaN: field not provided"]
13039 pub power_generated: f32,
13040 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
13041 pub bus_voltage: f32,
13042 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
13043 pub bat_current_setpoint: f32,
13044 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
13045 pub runtime: u32,
13046 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
13047 pub time_until_maintenance: i32,
13048 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
13049 pub generator_speed: u16,
13050 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
13051 pub rectifier_temperature: i16,
13052 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
13053 pub generator_temperature: i16,
13054}
13055impl GENERATOR_STATUS_DATA {
13056 pub const ENCODED_LEN: usize = 42usize;
13057 pub const DEFAULT: Self = Self {
13058 status: MavGeneratorStatusFlag::DEFAULT,
13059 battery_current: 0.0_f32,
13060 load_current: 0.0_f32,
13061 power_generated: 0.0_f32,
13062 bus_voltage: 0.0_f32,
13063 bat_current_setpoint: 0.0_f32,
13064 runtime: 0_u32,
13065 time_until_maintenance: 0_i32,
13066 generator_speed: 0_u16,
13067 rectifier_temperature: 0_i16,
13068 generator_temperature: 0_i16,
13069 };
13070 #[cfg(feature = "arbitrary")]
13071 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13072 use arbitrary::{Arbitrary, Unstructured};
13073 let mut buf = [0u8; 1024];
13074 rng.fill_bytes(&mut buf);
13075 let mut unstructured = Unstructured::new(&buf);
13076 Self::arbitrary(&mut unstructured).unwrap_or_default()
13077 }
13078}
13079impl Default for GENERATOR_STATUS_DATA {
13080 fn default() -> Self {
13081 Self::DEFAULT.clone()
13082 }
13083}
13084impl MessageData for GENERATOR_STATUS_DATA {
13085 type Message = MavMessage;
13086 const ID: u32 = 373u32;
13087 const NAME: &'static str = "GENERATOR_STATUS";
13088 const EXTRA_CRC: u8 = 117u8;
13089 const ENCODED_LEN: usize = 42usize;
13090 fn deser(
13091 _version: MavlinkVersion,
13092 __input: &[u8],
13093 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13094 let avail_len = __input.len();
13095 let mut payload_buf = [0; Self::ENCODED_LEN];
13096 let mut buf = if avail_len < Self::ENCODED_LEN {
13097 payload_buf[0..avail_len].copy_from_slice(__input);
13098 Bytes::new(&payload_buf)
13099 } else {
13100 Bytes::new(__input)
13101 };
13102 let mut __struct = Self::default();
13103 let tmp = buf.get_u64_le()?;
13104 __struct.status =
13105 MavGeneratorStatusFlag::from_bits(tmp as <MavGeneratorStatusFlag as Flags>::Bits)
13106 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13107 flag_type: "MavGeneratorStatusFlag",
13108 value: tmp as u64,
13109 })?;
13110 __struct.battery_current = buf.get_f32_le()?;
13111 __struct.load_current = buf.get_f32_le()?;
13112 __struct.power_generated = buf.get_f32_le()?;
13113 __struct.bus_voltage = buf.get_f32_le()?;
13114 __struct.bat_current_setpoint = buf.get_f32_le()?;
13115 __struct.runtime = buf.get_u32_le()?;
13116 __struct.time_until_maintenance = buf.get_i32_le()?;
13117 __struct.generator_speed = buf.get_u16_le()?;
13118 __struct.rectifier_temperature = buf.get_i16_le()?;
13119 __struct.generator_temperature = buf.get_i16_le()?;
13120 Ok(__struct)
13121 }
13122 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13123 let mut __tmp = BytesMut::new(bytes);
13124 #[allow(clippy::absurd_extreme_comparisons)]
13125 #[allow(unused_comparisons)]
13126 if __tmp.remaining() < Self::ENCODED_LEN {
13127 panic!(
13128 "buffer is too small (need {} bytes, but got {})",
13129 Self::ENCODED_LEN,
13130 __tmp.remaining(),
13131 )
13132 }
13133 __tmp.put_u64_le(self.status.bits() as u64);
13134 __tmp.put_f32_le(self.battery_current);
13135 __tmp.put_f32_le(self.load_current);
13136 __tmp.put_f32_le(self.power_generated);
13137 __tmp.put_f32_le(self.bus_voltage);
13138 __tmp.put_f32_le(self.bat_current_setpoint);
13139 __tmp.put_u32_le(self.runtime);
13140 __tmp.put_i32_le(self.time_until_maintenance);
13141 __tmp.put_u16_le(self.generator_speed);
13142 __tmp.put_i16_le(self.rectifier_temperature);
13143 __tmp.put_i16_le(self.generator_temperature);
13144 if matches!(version, MavlinkVersion::V2) {
13145 let len = __tmp.len();
13146 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13147 } else {
13148 __tmp.len()
13149 }
13150 }
13151}
13152#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
13153#[doc = ""]
13154#[doc = "ID: 285"]
13155#[derive(Debug, Clone, PartialEq)]
13156#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13157#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13158#[cfg_attr(feature = "ts", derive(TS))]
13159#[cfg_attr(feature = "ts", ts(export))]
13160pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
13161 #[doc = "Timestamp (time since system boot)."]
13162 pub time_boot_ms: u32,
13163 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
13164 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13165 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13166 pub q: [f32; 4],
13167 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
13168 pub angular_velocity_x: f32,
13169 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
13170 pub angular_velocity_y: f32,
13171 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
13172 pub angular_velocity_z: f32,
13173 #[doc = "Failure flags (0 for no failure)"]
13174 pub failure_flags: GimbalDeviceErrorFlags,
13175 #[doc = "Current gimbal flags set."]
13176 pub flags: GimbalDeviceFlags,
13177 #[doc = "System ID"]
13178 pub target_system: u8,
13179 #[doc = "Component ID"]
13180 pub target_component: u8,
13181 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
13182 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13183 pub delta_yaw: f32,
13184 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
13185 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13186 pub delta_yaw_velocity: f32,
13187 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
13188 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13189 pub gimbal_device_id: u8,
13190}
13191impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
13192 pub const ENCODED_LEN: usize = 49usize;
13193 pub const DEFAULT: Self = Self {
13194 time_boot_ms: 0_u32,
13195 q: [0.0_f32; 4usize],
13196 angular_velocity_x: 0.0_f32,
13197 angular_velocity_y: 0.0_f32,
13198 angular_velocity_z: 0.0_f32,
13199 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
13200 flags: GimbalDeviceFlags::DEFAULT,
13201 target_system: 0_u8,
13202 target_component: 0_u8,
13203 delta_yaw: 0.0_f32,
13204 delta_yaw_velocity: 0.0_f32,
13205 gimbal_device_id: 0_u8,
13206 };
13207 #[cfg(feature = "arbitrary")]
13208 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13209 use arbitrary::{Arbitrary, Unstructured};
13210 let mut buf = [0u8; 1024];
13211 rng.fill_bytes(&mut buf);
13212 let mut unstructured = Unstructured::new(&buf);
13213 Self::arbitrary(&mut unstructured).unwrap_or_default()
13214 }
13215}
13216impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
13217 fn default() -> Self {
13218 Self::DEFAULT.clone()
13219 }
13220}
13221impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
13222 type Message = MavMessage;
13223 const ID: u32 = 285u32;
13224 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
13225 const EXTRA_CRC: u8 = 137u8;
13226 const ENCODED_LEN: usize = 49usize;
13227 fn deser(
13228 _version: MavlinkVersion,
13229 __input: &[u8],
13230 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13231 let avail_len = __input.len();
13232 let mut payload_buf = [0; Self::ENCODED_LEN];
13233 let mut buf = if avail_len < Self::ENCODED_LEN {
13234 payload_buf[0..avail_len].copy_from_slice(__input);
13235 Bytes::new(&payload_buf)
13236 } else {
13237 Bytes::new(__input)
13238 };
13239 let mut __struct = Self::default();
13240 __struct.time_boot_ms = buf.get_u32_le()?;
13241 for v in &mut __struct.q {
13242 let val = buf.get_f32_le()?;
13243 *v = val;
13244 }
13245 __struct.angular_velocity_x = buf.get_f32_le()?;
13246 __struct.angular_velocity_y = buf.get_f32_le()?;
13247 __struct.angular_velocity_z = buf.get_f32_le()?;
13248 let tmp = buf.get_u32_le()?;
13249 __struct.failure_flags =
13250 GimbalDeviceErrorFlags::from_bits(tmp as <GimbalDeviceErrorFlags as Flags>::Bits)
13251 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13252 flag_type: "GimbalDeviceErrorFlags",
13253 value: tmp as u64,
13254 })?;
13255 let tmp = buf.get_u16_le()?;
13256 __struct.flags = GimbalDeviceFlags::from_bits(tmp as <GimbalDeviceFlags as Flags>::Bits)
13257 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13258 flag_type: "GimbalDeviceFlags",
13259 value: tmp as u64,
13260 })?;
13261 __struct.target_system = buf.get_u8()?;
13262 __struct.target_component = buf.get_u8()?;
13263 __struct.delta_yaw = buf.get_f32_le()?;
13264 __struct.delta_yaw_velocity = buf.get_f32_le()?;
13265 __struct.gimbal_device_id = buf.get_u8()?;
13266 Ok(__struct)
13267 }
13268 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13269 let mut __tmp = BytesMut::new(bytes);
13270 #[allow(clippy::absurd_extreme_comparisons)]
13271 #[allow(unused_comparisons)]
13272 if __tmp.remaining() < Self::ENCODED_LEN {
13273 panic!(
13274 "buffer is too small (need {} bytes, but got {})",
13275 Self::ENCODED_LEN,
13276 __tmp.remaining(),
13277 )
13278 }
13279 __tmp.put_u32_le(self.time_boot_ms);
13280 for val in &self.q {
13281 __tmp.put_f32_le(*val);
13282 }
13283 __tmp.put_f32_le(self.angular_velocity_x);
13284 __tmp.put_f32_le(self.angular_velocity_y);
13285 __tmp.put_f32_le(self.angular_velocity_z);
13286 __tmp.put_u32_le(self.failure_flags.bits() as u32);
13287 __tmp.put_u16_le(self.flags.bits() as u16);
13288 __tmp.put_u8(self.target_system);
13289 __tmp.put_u8(self.target_component);
13290 if matches!(version, MavlinkVersion::V2) {
13291 __tmp.put_f32_le(self.delta_yaw);
13292 __tmp.put_f32_le(self.delta_yaw_velocity);
13293 __tmp.put_u8(self.gimbal_device_id);
13294 let len = __tmp.len();
13295 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13296 } else {
13297 __tmp.len()
13298 }
13299 }
13300}
13301#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
13302#[doc = ""]
13303#[doc = "ID: 283"]
13304#[derive(Debug, Clone, PartialEq)]
13305#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13306#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13307#[cfg_attr(feature = "ts", derive(TS))]
13308#[cfg_attr(feature = "ts", ts(export))]
13309pub struct GIMBAL_DEVICE_INFORMATION_DATA {
13310 #[doc = "UID of gimbal hardware (0 if unknown)."]
13311 pub uid: u64,
13312 #[doc = "Timestamp (time since system boot)."]
13313 pub time_boot_ms: u32,
13314 #[doc = "Version of the gimbal firmware, encoded as: (Dev&0xff)<<24 | (Patch&0xff)<<16 | (Minor&0xff)<<8 | (Major&0xff)."]
13315 pub firmware_version: u32,
13316 #[doc = "Version of the gimbal hardware, encoded as: (Dev&0xff)<<24 | (Patch&0xff)<<16 | (Minor&0xff)<<8 | (Major&0xff)."]
13317 pub hardware_version: u32,
13318 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
13319 pub roll_min: f32,
13320 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
13321 pub roll_max: f32,
13322 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
13323 pub pitch_min: f32,
13324 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
13325 pub pitch_max: f32,
13326 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
13327 pub yaw_min: f32,
13328 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
13329 pub yaw_max: f32,
13330 #[doc = "Bitmap of gimbal capability flags."]
13331 pub cap_flags: GimbalDeviceCapFlags,
13332 #[doc = "Bitmap for use for gimbal-specific capability flags."]
13333 pub custom_cap_flags: u16,
13334 #[doc = "Name of the gimbal vendor."]
13335 #[cfg_attr(feature = "ts", ts(type = "string"))]
13336 pub vendor_name: CharArray<32>,
13337 #[doc = "Name of the gimbal model."]
13338 #[cfg_attr(feature = "ts", ts(type = "string"))]
13339 pub model_name: CharArray<32>,
13340 #[doc = "Custom name of the gimbal given to it by the user."]
13341 #[cfg_attr(feature = "ts", ts(type = "string"))]
13342 pub custom_name: CharArray<32>,
13343 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
13344 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13345 pub gimbal_device_id: u8,
13346}
13347impl GIMBAL_DEVICE_INFORMATION_DATA {
13348 pub const ENCODED_LEN: usize = 145usize;
13349 pub const DEFAULT: Self = Self {
13350 uid: 0_u64,
13351 time_boot_ms: 0_u32,
13352 firmware_version: 0_u32,
13353 hardware_version: 0_u32,
13354 roll_min: 0.0_f32,
13355 roll_max: 0.0_f32,
13356 pitch_min: 0.0_f32,
13357 pitch_max: 0.0_f32,
13358 yaw_min: 0.0_f32,
13359 yaw_max: 0.0_f32,
13360 cap_flags: GimbalDeviceCapFlags::DEFAULT,
13361 custom_cap_flags: 0_u16,
13362 vendor_name: CharArray::new([0_u8; 32usize]),
13363 model_name: CharArray::new([0_u8; 32usize]),
13364 custom_name: CharArray::new([0_u8; 32usize]),
13365 gimbal_device_id: 0_u8,
13366 };
13367 #[cfg(feature = "arbitrary")]
13368 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13369 use arbitrary::{Arbitrary, Unstructured};
13370 let mut buf = [0u8; 1024];
13371 rng.fill_bytes(&mut buf);
13372 let mut unstructured = Unstructured::new(&buf);
13373 Self::arbitrary(&mut unstructured).unwrap_or_default()
13374 }
13375}
13376impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
13377 fn default() -> Self {
13378 Self::DEFAULT.clone()
13379 }
13380}
13381impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
13382 type Message = MavMessage;
13383 const ID: u32 = 283u32;
13384 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
13385 const EXTRA_CRC: u8 = 74u8;
13386 const ENCODED_LEN: usize = 145usize;
13387 fn deser(
13388 _version: MavlinkVersion,
13389 __input: &[u8],
13390 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13391 let avail_len = __input.len();
13392 let mut payload_buf = [0; Self::ENCODED_LEN];
13393 let mut buf = if avail_len < Self::ENCODED_LEN {
13394 payload_buf[0..avail_len].copy_from_slice(__input);
13395 Bytes::new(&payload_buf)
13396 } else {
13397 Bytes::new(__input)
13398 };
13399 let mut __struct = Self::default();
13400 __struct.uid = buf.get_u64_le()?;
13401 __struct.time_boot_ms = buf.get_u32_le()?;
13402 __struct.firmware_version = buf.get_u32_le()?;
13403 __struct.hardware_version = buf.get_u32_le()?;
13404 __struct.roll_min = buf.get_f32_le()?;
13405 __struct.roll_max = buf.get_f32_le()?;
13406 __struct.pitch_min = buf.get_f32_le()?;
13407 __struct.pitch_max = buf.get_f32_le()?;
13408 __struct.yaw_min = buf.get_f32_le()?;
13409 __struct.yaw_max = buf.get_f32_le()?;
13410 let tmp = buf.get_u16_le()?;
13411 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
13412 tmp as <GimbalDeviceCapFlags as Flags>::Bits,
13413 )
13414 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13415 flag_type: "GimbalDeviceCapFlags",
13416 value: tmp as u64,
13417 })?;
13418 __struct.custom_cap_flags = buf.get_u16_le()?;
13419 let mut tmp = [0_u8; 32usize];
13420 for v in &mut tmp {
13421 *v = buf.get_u8()?;
13422 }
13423 __struct.vendor_name = CharArray::new(tmp);
13424 let mut tmp = [0_u8; 32usize];
13425 for v in &mut tmp {
13426 *v = buf.get_u8()?;
13427 }
13428 __struct.model_name = CharArray::new(tmp);
13429 let mut tmp = [0_u8; 32usize];
13430 for v in &mut tmp {
13431 *v = buf.get_u8()?;
13432 }
13433 __struct.custom_name = CharArray::new(tmp);
13434 __struct.gimbal_device_id = buf.get_u8()?;
13435 Ok(__struct)
13436 }
13437 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13438 let mut __tmp = BytesMut::new(bytes);
13439 #[allow(clippy::absurd_extreme_comparisons)]
13440 #[allow(unused_comparisons)]
13441 if __tmp.remaining() < Self::ENCODED_LEN {
13442 panic!(
13443 "buffer is too small (need {} bytes, but got {})",
13444 Self::ENCODED_LEN,
13445 __tmp.remaining(),
13446 )
13447 }
13448 __tmp.put_u64_le(self.uid);
13449 __tmp.put_u32_le(self.time_boot_ms);
13450 __tmp.put_u32_le(self.firmware_version);
13451 __tmp.put_u32_le(self.hardware_version);
13452 __tmp.put_f32_le(self.roll_min);
13453 __tmp.put_f32_le(self.roll_max);
13454 __tmp.put_f32_le(self.pitch_min);
13455 __tmp.put_f32_le(self.pitch_max);
13456 __tmp.put_f32_le(self.yaw_min);
13457 __tmp.put_f32_le(self.yaw_max);
13458 __tmp.put_u16_le(self.cap_flags.bits() as u16);
13459 __tmp.put_u16_le(self.custom_cap_flags);
13460 for val in &self.vendor_name {
13461 __tmp.put_u8(*val);
13462 }
13463 for val in &self.model_name {
13464 __tmp.put_u8(*val);
13465 }
13466 for val in &self.custom_name {
13467 __tmp.put_u8(*val);
13468 }
13469 if matches!(version, MavlinkVersion::V2) {
13470 __tmp.put_u8(self.gimbal_device_id);
13471 let len = __tmp.len();
13472 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13473 } else {
13474 __tmp.len()
13475 }
13476 }
13477}
13478#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
13479#[doc = ""]
13480#[doc = "ID: 284"]
13481#[derive(Debug, Clone, PartialEq)]
13482#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13483#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13484#[cfg_attr(feature = "ts", derive(TS))]
13485#[cfg_attr(feature = "ts", ts(export))]
13486pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13487 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
13488 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13489 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13490 pub q: [f32; 4],
13491 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
13492 pub angular_velocity_x: f32,
13493 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
13494 pub angular_velocity_y: f32,
13495 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
13496 pub angular_velocity_z: f32,
13497 #[doc = "Low level gimbal flags."]
13498 pub flags: GimbalDeviceFlags,
13499 #[doc = "System ID"]
13500 pub target_system: u8,
13501 #[doc = "Component ID"]
13502 pub target_component: u8,
13503}
13504impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13505 pub const ENCODED_LEN: usize = 32usize;
13506 pub const DEFAULT: Self = Self {
13507 q: [0.0_f32; 4usize],
13508 angular_velocity_x: 0.0_f32,
13509 angular_velocity_y: 0.0_f32,
13510 angular_velocity_z: 0.0_f32,
13511 flags: GimbalDeviceFlags::DEFAULT,
13512 target_system: 0_u8,
13513 target_component: 0_u8,
13514 };
13515 #[cfg(feature = "arbitrary")]
13516 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13517 use arbitrary::{Arbitrary, Unstructured};
13518 let mut buf = [0u8; 1024];
13519 rng.fill_bytes(&mut buf);
13520 let mut unstructured = Unstructured::new(&buf);
13521 Self::arbitrary(&mut unstructured).unwrap_or_default()
13522 }
13523}
13524impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13525 fn default() -> Self {
13526 Self::DEFAULT.clone()
13527 }
13528}
13529impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
13530 type Message = MavMessage;
13531 const ID: u32 = 284u32;
13532 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
13533 const EXTRA_CRC: u8 = 99u8;
13534 const ENCODED_LEN: usize = 32usize;
13535 fn deser(
13536 _version: MavlinkVersion,
13537 __input: &[u8],
13538 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13539 let avail_len = __input.len();
13540 let mut payload_buf = [0; Self::ENCODED_LEN];
13541 let mut buf = if avail_len < Self::ENCODED_LEN {
13542 payload_buf[0..avail_len].copy_from_slice(__input);
13543 Bytes::new(&payload_buf)
13544 } else {
13545 Bytes::new(__input)
13546 };
13547 let mut __struct = Self::default();
13548 for v in &mut __struct.q {
13549 let val = buf.get_f32_le()?;
13550 *v = val;
13551 }
13552 __struct.angular_velocity_x = buf.get_f32_le()?;
13553 __struct.angular_velocity_y = buf.get_f32_le()?;
13554 __struct.angular_velocity_z = buf.get_f32_le()?;
13555 let tmp = buf.get_u16_le()?;
13556 __struct.flags = GimbalDeviceFlags::from_bits(tmp as <GimbalDeviceFlags as Flags>::Bits)
13557 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13558 flag_type: "GimbalDeviceFlags",
13559 value: tmp as u64,
13560 })?;
13561 __struct.target_system = buf.get_u8()?;
13562 __struct.target_component = buf.get_u8()?;
13563 Ok(__struct)
13564 }
13565 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13566 let mut __tmp = BytesMut::new(bytes);
13567 #[allow(clippy::absurd_extreme_comparisons)]
13568 #[allow(unused_comparisons)]
13569 if __tmp.remaining() < Self::ENCODED_LEN {
13570 panic!(
13571 "buffer is too small (need {} bytes, but got {})",
13572 Self::ENCODED_LEN,
13573 __tmp.remaining(),
13574 )
13575 }
13576 for val in &self.q {
13577 __tmp.put_f32_le(*val);
13578 }
13579 __tmp.put_f32_le(self.angular_velocity_x);
13580 __tmp.put_f32_le(self.angular_velocity_y);
13581 __tmp.put_f32_le(self.angular_velocity_z);
13582 __tmp.put_u16_le(self.flags.bits() as u16);
13583 __tmp.put_u8(self.target_system);
13584 __tmp.put_u8(self.target_component);
13585 if matches!(version, MavlinkVersion::V2) {
13586 let len = __tmp.len();
13587 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13588 } else {
13589 __tmp.len()
13590 }
13591 }
13592}
13593#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
13594#[doc = ""]
13595#[doc = "ID: 280"]
13596#[derive(Debug, Clone, PartialEq)]
13597#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13598#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13599#[cfg_attr(feature = "ts", derive(TS))]
13600#[cfg_attr(feature = "ts", ts(export))]
13601pub struct GIMBAL_MANAGER_INFORMATION_DATA {
13602 #[doc = "Timestamp (time since system boot)."]
13603 pub time_boot_ms: u32,
13604 #[doc = "Bitmap of gimbal capability flags."]
13605 pub cap_flags: GimbalManagerCapFlags,
13606 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
13607 pub roll_min: f32,
13608 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
13609 pub roll_max: f32,
13610 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
13611 pub pitch_min: f32,
13612 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
13613 pub pitch_max: f32,
13614 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
13615 pub yaw_min: f32,
13616 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
13617 pub yaw_max: f32,
13618 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13619 pub gimbal_device_id: u8,
13620}
13621impl GIMBAL_MANAGER_INFORMATION_DATA {
13622 pub const ENCODED_LEN: usize = 33usize;
13623 pub const DEFAULT: Self = Self {
13624 time_boot_ms: 0_u32,
13625 cap_flags: GimbalManagerCapFlags::DEFAULT,
13626 roll_min: 0.0_f32,
13627 roll_max: 0.0_f32,
13628 pitch_min: 0.0_f32,
13629 pitch_max: 0.0_f32,
13630 yaw_min: 0.0_f32,
13631 yaw_max: 0.0_f32,
13632 gimbal_device_id: 0_u8,
13633 };
13634 #[cfg(feature = "arbitrary")]
13635 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13636 use arbitrary::{Arbitrary, Unstructured};
13637 let mut buf = [0u8; 1024];
13638 rng.fill_bytes(&mut buf);
13639 let mut unstructured = Unstructured::new(&buf);
13640 Self::arbitrary(&mut unstructured).unwrap_or_default()
13641 }
13642}
13643impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
13644 fn default() -> Self {
13645 Self::DEFAULT.clone()
13646 }
13647}
13648impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
13649 type Message = MavMessage;
13650 const ID: u32 = 280u32;
13651 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
13652 const EXTRA_CRC: u8 = 70u8;
13653 const ENCODED_LEN: usize = 33usize;
13654 fn deser(
13655 _version: MavlinkVersion,
13656 __input: &[u8],
13657 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13658 let avail_len = __input.len();
13659 let mut payload_buf = [0; Self::ENCODED_LEN];
13660 let mut buf = if avail_len < Self::ENCODED_LEN {
13661 payload_buf[0..avail_len].copy_from_slice(__input);
13662 Bytes::new(&payload_buf)
13663 } else {
13664 Bytes::new(__input)
13665 };
13666 let mut __struct = Self::default();
13667 __struct.time_boot_ms = buf.get_u32_le()?;
13668 let tmp = buf.get_u32_le()?;
13669 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
13670 tmp as <GimbalManagerCapFlags as Flags>::Bits,
13671 )
13672 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13673 flag_type: "GimbalManagerCapFlags",
13674 value: tmp as u64,
13675 })?;
13676 __struct.roll_min = buf.get_f32_le()?;
13677 __struct.roll_max = buf.get_f32_le()?;
13678 __struct.pitch_min = buf.get_f32_le()?;
13679 __struct.pitch_max = buf.get_f32_le()?;
13680 __struct.yaw_min = buf.get_f32_le()?;
13681 __struct.yaw_max = buf.get_f32_le()?;
13682 __struct.gimbal_device_id = buf.get_u8()?;
13683 Ok(__struct)
13684 }
13685 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13686 let mut __tmp = BytesMut::new(bytes);
13687 #[allow(clippy::absurd_extreme_comparisons)]
13688 #[allow(unused_comparisons)]
13689 if __tmp.remaining() < Self::ENCODED_LEN {
13690 panic!(
13691 "buffer is too small (need {} bytes, but got {})",
13692 Self::ENCODED_LEN,
13693 __tmp.remaining(),
13694 )
13695 }
13696 __tmp.put_u32_le(self.time_boot_ms);
13697 __tmp.put_u32_le(self.cap_flags.bits() as u32);
13698 __tmp.put_f32_le(self.roll_min);
13699 __tmp.put_f32_le(self.roll_max);
13700 __tmp.put_f32_le(self.pitch_min);
13701 __tmp.put_f32_le(self.pitch_max);
13702 __tmp.put_f32_le(self.yaw_min);
13703 __tmp.put_f32_le(self.yaw_max);
13704 __tmp.put_u8(self.gimbal_device_id);
13705 if matches!(version, MavlinkVersion::V2) {
13706 let len = __tmp.len();
13707 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13708 } else {
13709 __tmp.len()
13710 }
13711 }
13712}
13713#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13714#[doc = ""]
13715#[doc = "ID: 282"]
13716#[derive(Debug, Clone, PartialEq)]
13717#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13718#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13719#[cfg_attr(feature = "ts", derive(TS))]
13720#[cfg_attr(feature = "ts", ts(export))]
13721pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13722 #[doc = "High level gimbal manager flags to use."]
13723 pub flags: GimbalManagerFlags,
13724 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
13725 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13726 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
13727 pub q: [f32; 4],
13728 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
13729 pub angular_velocity_x: f32,
13730 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
13731 pub angular_velocity_y: f32,
13732 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
13733 pub angular_velocity_z: f32,
13734 #[doc = "System ID"]
13735 pub target_system: u8,
13736 #[doc = "Component ID"]
13737 pub target_component: u8,
13738 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13739 pub gimbal_device_id: u8,
13740}
13741impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13742 pub const ENCODED_LEN: usize = 35usize;
13743 pub const DEFAULT: Self = Self {
13744 flags: GimbalManagerFlags::DEFAULT,
13745 q: [0.0_f32; 4usize],
13746 angular_velocity_x: 0.0_f32,
13747 angular_velocity_y: 0.0_f32,
13748 angular_velocity_z: 0.0_f32,
13749 target_system: 0_u8,
13750 target_component: 0_u8,
13751 gimbal_device_id: 0_u8,
13752 };
13753 #[cfg(feature = "arbitrary")]
13754 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13755 use arbitrary::{Arbitrary, Unstructured};
13756 let mut buf = [0u8; 1024];
13757 rng.fill_bytes(&mut buf);
13758 let mut unstructured = Unstructured::new(&buf);
13759 Self::arbitrary(&mut unstructured).unwrap_or_default()
13760 }
13761}
13762impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13763 fn default() -> Self {
13764 Self::DEFAULT.clone()
13765 }
13766}
13767impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
13768 type Message = MavMessage;
13769 const ID: u32 = 282u32;
13770 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
13771 const EXTRA_CRC: u8 = 123u8;
13772 const ENCODED_LEN: usize = 35usize;
13773 fn deser(
13774 _version: MavlinkVersion,
13775 __input: &[u8],
13776 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13777 let avail_len = __input.len();
13778 let mut payload_buf = [0; Self::ENCODED_LEN];
13779 let mut buf = if avail_len < Self::ENCODED_LEN {
13780 payload_buf[0..avail_len].copy_from_slice(__input);
13781 Bytes::new(&payload_buf)
13782 } else {
13783 Bytes::new(__input)
13784 };
13785 let mut __struct = Self::default();
13786 let tmp = buf.get_u32_le()?;
13787 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
13788 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13789 flag_type: "GimbalManagerFlags",
13790 value: tmp as u64,
13791 })?;
13792 for v in &mut __struct.q {
13793 let val = buf.get_f32_le()?;
13794 *v = val;
13795 }
13796 __struct.angular_velocity_x = buf.get_f32_le()?;
13797 __struct.angular_velocity_y = buf.get_f32_le()?;
13798 __struct.angular_velocity_z = buf.get_f32_le()?;
13799 __struct.target_system = buf.get_u8()?;
13800 __struct.target_component = buf.get_u8()?;
13801 __struct.gimbal_device_id = buf.get_u8()?;
13802 Ok(__struct)
13803 }
13804 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13805 let mut __tmp = BytesMut::new(bytes);
13806 #[allow(clippy::absurd_extreme_comparisons)]
13807 #[allow(unused_comparisons)]
13808 if __tmp.remaining() < Self::ENCODED_LEN {
13809 panic!(
13810 "buffer is too small (need {} bytes, but got {})",
13811 Self::ENCODED_LEN,
13812 __tmp.remaining(),
13813 )
13814 }
13815 __tmp.put_u32_le(self.flags.bits() as u32);
13816 for val in &self.q {
13817 __tmp.put_f32_le(*val);
13818 }
13819 __tmp.put_f32_le(self.angular_velocity_x);
13820 __tmp.put_f32_le(self.angular_velocity_y);
13821 __tmp.put_f32_le(self.angular_velocity_z);
13822 __tmp.put_u8(self.target_system);
13823 __tmp.put_u8(self.target_component);
13824 __tmp.put_u8(self.gimbal_device_id);
13825 if matches!(version, MavlinkVersion::V2) {
13826 let len = __tmp.len();
13827 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13828 } else {
13829 __tmp.len()
13830 }
13831 }
13832}
13833#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
13834#[doc = ""]
13835#[doc = "ID: 288"]
13836#[derive(Debug, Clone, PartialEq)]
13837#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13838#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13839#[cfg_attr(feature = "ts", derive(TS))]
13840#[cfg_attr(feature = "ts", ts(export))]
13841pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13842 #[doc = "High level gimbal manager flags."]
13843 pub flags: GimbalManagerFlags,
13844 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13845 pub pitch: f32,
13846 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13847 pub yaw: f32,
13848 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
13849 pub pitch_rate: f32,
13850 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
13851 pub yaw_rate: f32,
13852 #[doc = "System ID"]
13853 pub target_system: u8,
13854 #[doc = "Component ID"]
13855 pub target_component: u8,
13856 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13857 pub gimbal_device_id: u8,
13858}
13859impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13860 pub const ENCODED_LEN: usize = 23usize;
13861 pub const DEFAULT: Self = Self {
13862 flags: GimbalManagerFlags::DEFAULT,
13863 pitch: 0.0_f32,
13864 yaw: 0.0_f32,
13865 pitch_rate: 0.0_f32,
13866 yaw_rate: 0.0_f32,
13867 target_system: 0_u8,
13868 target_component: 0_u8,
13869 gimbal_device_id: 0_u8,
13870 };
13871 #[cfg(feature = "arbitrary")]
13872 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13873 use arbitrary::{Arbitrary, Unstructured};
13874 let mut buf = [0u8; 1024];
13875 rng.fill_bytes(&mut buf);
13876 let mut unstructured = Unstructured::new(&buf);
13877 Self::arbitrary(&mut unstructured).unwrap_or_default()
13878 }
13879}
13880impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13881 fn default() -> Self {
13882 Self::DEFAULT.clone()
13883 }
13884}
13885impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13886 type Message = MavMessage;
13887 const ID: u32 = 288u32;
13888 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
13889 const EXTRA_CRC: u8 = 20u8;
13890 const ENCODED_LEN: usize = 23usize;
13891 fn deser(
13892 _version: MavlinkVersion,
13893 __input: &[u8],
13894 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13895 let avail_len = __input.len();
13896 let mut payload_buf = [0; Self::ENCODED_LEN];
13897 let mut buf = if avail_len < Self::ENCODED_LEN {
13898 payload_buf[0..avail_len].copy_from_slice(__input);
13899 Bytes::new(&payload_buf)
13900 } else {
13901 Bytes::new(__input)
13902 };
13903 let mut __struct = Self::default();
13904 let tmp = buf.get_u32_le()?;
13905 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
13906 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13907 flag_type: "GimbalManagerFlags",
13908 value: tmp as u64,
13909 })?;
13910 __struct.pitch = buf.get_f32_le()?;
13911 __struct.yaw = buf.get_f32_le()?;
13912 __struct.pitch_rate = buf.get_f32_le()?;
13913 __struct.yaw_rate = buf.get_f32_le()?;
13914 __struct.target_system = buf.get_u8()?;
13915 __struct.target_component = buf.get_u8()?;
13916 __struct.gimbal_device_id = buf.get_u8()?;
13917 Ok(__struct)
13918 }
13919 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13920 let mut __tmp = BytesMut::new(bytes);
13921 #[allow(clippy::absurd_extreme_comparisons)]
13922 #[allow(unused_comparisons)]
13923 if __tmp.remaining() < Self::ENCODED_LEN {
13924 panic!(
13925 "buffer is too small (need {} bytes, but got {})",
13926 Self::ENCODED_LEN,
13927 __tmp.remaining(),
13928 )
13929 }
13930 __tmp.put_u32_le(self.flags.bits() as u32);
13931 __tmp.put_f32_le(self.pitch);
13932 __tmp.put_f32_le(self.yaw);
13933 __tmp.put_f32_le(self.pitch_rate);
13934 __tmp.put_f32_le(self.yaw_rate);
13935 __tmp.put_u8(self.target_system);
13936 __tmp.put_u8(self.target_component);
13937 __tmp.put_u8(self.gimbal_device_id);
13938 if matches!(version, MavlinkVersion::V2) {
13939 let len = __tmp.len();
13940 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13941 } else {
13942 __tmp.len()
13943 }
13944 }
13945}
13946#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
13947#[doc = ""]
13948#[doc = "ID: 287"]
13949#[derive(Debug, Clone, PartialEq)]
13950#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13951#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13952#[cfg_attr(feature = "ts", derive(TS))]
13953#[cfg_attr(feature = "ts", ts(export))]
13954pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13955 #[doc = "High level gimbal manager flags to use."]
13956 pub flags: GimbalManagerFlags,
13957 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
13958 pub pitch: f32,
13959 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
13960 pub yaw: f32,
13961 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
13962 pub pitch_rate: f32,
13963 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
13964 pub yaw_rate: f32,
13965 #[doc = "System ID"]
13966 pub target_system: u8,
13967 #[doc = "Component ID"]
13968 pub target_component: u8,
13969 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13970 pub gimbal_device_id: u8,
13971}
13972impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13973 pub const ENCODED_LEN: usize = 23usize;
13974 pub const DEFAULT: Self = Self {
13975 flags: GimbalManagerFlags::DEFAULT,
13976 pitch: 0.0_f32,
13977 yaw: 0.0_f32,
13978 pitch_rate: 0.0_f32,
13979 yaw_rate: 0.0_f32,
13980 target_system: 0_u8,
13981 target_component: 0_u8,
13982 gimbal_device_id: 0_u8,
13983 };
13984 #[cfg(feature = "arbitrary")]
13985 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13986 use arbitrary::{Arbitrary, Unstructured};
13987 let mut buf = [0u8; 1024];
13988 rng.fill_bytes(&mut buf);
13989 let mut unstructured = Unstructured::new(&buf);
13990 Self::arbitrary(&mut unstructured).unwrap_or_default()
13991 }
13992}
13993impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13994 fn default() -> Self {
13995 Self::DEFAULT.clone()
13996 }
13997}
13998impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13999 type Message = MavMessage;
14000 const ID: u32 = 287u32;
14001 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
14002 const EXTRA_CRC: u8 = 1u8;
14003 const ENCODED_LEN: usize = 23usize;
14004 fn deser(
14005 _version: MavlinkVersion,
14006 __input: &[u8],
14007 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14008 let avail_len = __input.len();
14009 let mut payload_buf = [0; Self::ENCODED_LEN];
14010 let mut buf = if avail_len < Self::ENCODED_LEN {
14011 payload_buf[0..avail_len].copy_from_slice(__input);
14012 Bytes::new(&payload_buf)
14013 } else {
14014 Bytes::new(__input)
14015 };
14016 let mut __struct = Self::default();
14017 let tmp = buf.get_u32_le()?;
14018 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
14019 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14020 flag_type: "GimbalManagerFlags",
14021 value: tmp as u64,
14022 })?;
14023 __struct.pitch = buf.get_f32_le()?;
14024 __struct.yaw = buf.get_f32_le()?;
14025 __struct.pitch_rate = buf.get_f32_le()?;
14026 __struct.yaw_rate = buf.get_f32_le()?;
14027 __struct.target_system = buf.get_u8()?;
14028 __struct.target_component = buf.get_u8()?;
14029 __struct.gimbal_device_id = buf.get_u8()?;
14030 Ok(__struct)
14031 }
14032 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14033 let mut __tmp = BytesMut::new(bytes);
14034 #[allow(clippy::absurd_extreme_comparisons)]
14035 #[allow(unused_comparisons)]
14036 if __tmp.remaining() < Self::ENCODED_LEN {
14037 panic!(
14038 "buffer is too small (need {} bytes, but got {})",
14039 Self::ENCODED_LEN,
14040 __tmp.remaining(),
14041 )
14042 }
14043 __tmp.put_u32_le(self.flags.bits() as u32);
14044 __tmp.put_f32_le(self.pitch);
14045 __tmp.put_f32_le(self.yaw);
14046 __tmp.put_f32_le(self.pitch_rate);
14047 __tmp.put_f32_le(self.yaw_rate);
14048 __tmp.put_u8(self.target_system);
14049 __tmp.put_u8(self.target_component);
14050 __tmp.put_u8(self.gimbal_device_id);
14051 if matches!(version, MavlinkVersion::V2) {
14052 let len = __tmp.len();
14053 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14054 } else {
14055 __tmp.len()
14056 }
14057 }
14058}
14059#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
14060#[doc = ""]
14061#[doc = "ID: 281"]
14062#[derive(Debug, Clone, PartialEq)]
14063#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14064#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14065#[cfg_attr(feature = "ts", derive(TS))]
14066#[cfg_attr(feature = "ts", ts(export))]
14067pub struct GIMBAL_MANAGER_STATUS_DATA {
14068 #[doc = "Timestamp (time since system boot)."]
14069 pub time_boot_ms: u32,
14070 #[doc = "High level gimbal manager flags currently applied."]
14071 pub flags: GimbalManagerFlags,
14072 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
14073 pub gimbal_device_id: u8,
14074 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
14075 pub primary_control_sysid: u8,
14076 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
14077 pub primary_control_compid: u8,
14078 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
14079 pub secondary_control_sysid: u8,
14080 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
14081 pub secondary_control_compid: u8,
14082}
14083impl GIMBAL_MANAGER_STATUS_DATA {
14084 pub const ENCODED_LEN: usize = 13usize;
14085 pub const DEFAULT: Self = Self {
14086 time_boot_ms: 0_u32,
14087 flags: GimbalManagerFlags::DEFAULT,
14088 gimbal_device_id: 0_u8,
14089 primary_control_sysid: 0_u8,
14090 primary_control_compid: 0_u8,
14091 secondary_control_sysid: 0_u8,
14092 secondary_control_compid: 0_u8,
14093 };
14094 #[cfg(feature = "arbitrary")]
14095 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14096 use arbitrary::{Arbitrary, Unstructured};
14097 let mut buf = [0u8; 1024];
14098 rng.fill_bytes(&mut buf);
14099 let mut unstructured = Unstructured::new(&buf);
14100 Self::arbitrary(&mut unstructured).unwrap_or_default()
14101 }
14102}
14103impl Default for GIMBAL_MANAGER_STATUS_DATA {
14104 fn default() -> Self {
14105 Self::DEFAULT.clone()
14106 }
14107}
14108impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
14109 type Message = MavMessage;
14110 const ID: u32 = 281u32;
14111 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
14112 const EXTRA_CRC: u8 = 48u8;
14113 const ENCODED_LEN: usize = 13usize;
14114 fn deser(
14115 _version: MavlinkVersion,
14116 __input: &[u8],
14117 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14118 let avail_len = __input.len();
14119 let mut payload_buf = [0; Self::ENCODED_LEN];
14120 let mut buf = if avail_len < Self::ENCODED_LEN {
14121 payload_buf[0..avail_len].copy_from_slice(__input);
14122 Bytes::new(&payload_buf)
14123 } else {
14124 Bytes::new(__input)
14125 };
14126 let mut __struct = Self::default();
14127 __struct.time_boot_ms = buf.get_u32_le()?;
14128 let tmp = buf.get_u32_le()?;
14129 __struct.flags = GimbalManagerFlags::from_bits(tmp as <GimbalManagerFlags as Flags>::Bits)
14130 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14131 flag_type: "GimbalManagerFlags",
14132 value: tmp as u64,
14133 })?;
14134 __struct.gimbal_device_id = buf.get_u8()?;
14135 __struct.primary_control_sysid = buf.get_u8()?;
14136 __struct.primary_control_compid = buf.get_u8()?;
14137 __struct.secondary_control_sysid = buf.get_u8()?;
14138 __struct.secondary_control_compid = buf.get_u8()?;
14139 Ok(__struct)
14140 }
14141 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14142 let mut __tmp = BytesMut::new(bytes);
14143 #[allow(clippy::absurd_extreme_comparisons)]
14144 #[allow(unused_comparisons)]
14145 if __tmp.remaining() < Self::ENCODED_LEN {
14146 panic!(
14147 "buffer is too small (need {} bytes, but got {})",
14148 Self::ENCODED_LEN,
14149 __tmp.remaining(),
14150 )
14151 }
14152 __tmp.put_u32_le(self.time_boot_ms);
14153 __tmp.put_u32_le(self.flags.bits() as u32);
14154 __tmp.put_u8(self.gimbal_device_id);
14155 __tmp.put_u8(self.primary_control_sysid);
14156 __tmp.put_u8(self.primary_control_compid);
14157 __tmp.put_u8(self.secondary_control_sysid);
14158 __tmp.put_u8(self.secondary_control_compid);
14159 if matches!(version, MavlinkVersion::V2) {
14160 let len = __tmp.len();
14161 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14162 } else {
14163 __tmp.len()
14164 }
14165 }
14166}
14167#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
14168#[doc = ""]
14169#[doc = "ID: 33"]
14170#[derive(Debug, Clone, PartialEq)]
14171#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14172#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14173#[cfg_attr(feature = "ts", derive(TS))]
14174#[cfg_attr(feature = "ts", ts(export))]
14175pub struct GLOBAL_POSITION_INT_DATA {
14176 #[doc = "Timestamp (time since system boot)."]
14177 pub time_boot_ms: u32,
14178 #[doc = "Latitude, expressed"]
14179 pub lat: i32,
14180 #[doc = "Longitude, expressed"]
14181 pub lon: i32,
14182 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
14183 pub alt: i32,
14184 #[doc = "Altitude above home"]
14185 pub relative_alt: i32,
14186 #[doc = "Ground X Speed (Latitude, positive north)"]
14187 pub vx: i16,
14188 #[doc = "Ground Y Speed (Longitude, positive east)"]
14189 pub vy: i16,
14190 #[doc = "Ground Z Speed (Altitude, positive down)"]
14191 pub vz: i16,
14192 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14193 pub hdg: u16,
14194}
14195impl GLOBAL_POSITION_INT_DATA {
14196 pub const ENCODED_LEN: usize = 28usize;
14197 pub const DEFAULT: Self = Self {
14198 time_boot_ms: 0_u32,
14199 lat: 0_i32,
14200 lon: 0_i32,
14201 alt: 0_i32,
14202 relative_alt: 0_i32,
14203 vx: 0_i16,
14204 vy: 0_i16,
14205 vz: 0_i16,
14206 hdg: 0_u16,
14207 };
14208 #[cfg(feature = "arbitrary")]
14209 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14210 use arbitrary::{Arbitrary, Unstructured};
14211 let mut buf = [0u8; 1024];
14212 rng.fill_bytes(&mut buf);
14213 let mut unstructured = Unstructured::new(&buf);
14214 Self::arbitrary(&mut unstructured).unwrap_or_default()
14215 }
14216}
14217impl Default for GLOBAL_POSITION_INT_DATA {
14218 fn default() -> Self {
14219 Self::DEFAULT.clone()
14220 }
14221}
14222impl MessageData for GLOBAL_POSITION_INT_DATA {
14223 type Message = MavMessage;
14224 const ID: u32 = 33u32;
14225 const NAME: &'static str = "GLOBAL_POSITION_INT";
14226 const EXTRA_CRC: u8 = 104u8;
14227 const ENCODED_LEN: usize = 28usize;
14228 fn deser(
14229 _version: MavlinkVersion,
14230 __input: &[u8],
14231 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14232 let avail_len = __input.len();
14233 let mut payload_buf = [0; Self::ENCODED_LEN];
14234 let mut buf = if avail_len < Self::ENCODED_LEN {
14235 payload_buf[0..avail_len].copy_from_slice(__input);
14236 Bytes::new(&payload_buf)
14237 } else {
14238 Bytes::new(__input)
14239 };
14240 let mut __struct = Self::default();
14241 __struct.time_boot_ms = buf.get_u32_le()?;
14242 __struct.lat = buf.get_i32_le()?;
14243 __struct.lon = buf.get_i32_le()?;
14244 __struct.alt = buf.get_i32_le()?;
14245 __struct.relative_alt = buf.get_i32_le()?;
14246 __struct.vx = buf.get_i16_le()?;
14247 __struct.vy = buf.get_i16_le()?;
14248 __struct.vz = buf.get_i16_le()?;
14249 __struct.hdg = buf.get_u16_le()?;
14250 Ok(__struct)
14251 }
14252 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14253 let mut __tmp = BytesMut::new(bytes);
14254 #[allow(clippy::absurd_extreme_comparisons)]
14255 #[allow(unused_comparisons)]
14256 if __tmp.remaining() < Self::ENCODED_LEN {
14257 panic!(
14258 "buffer is too small (need {} bytes, but got {})",
14259 Self::ENCODED_LEN,
14260 __tmp.remaining(),
14261 )
14262 }
14263 __tmp.put_u32_le(self.time_boot_ms);
14264 __tmp.put_i32_le(self.lat);
14265 __tmp.put_i32_le(self.lon);
14266 __tmp.put_i32_le(self.alt);
14267 __tmp.put_i32_le(self.relative_alt);
14268 __tmp.put_i16_le(self.vx);
14269 __tmp.put_i16_le(self.vy);
14270 __tmp.put_i16_le(self.vz);
14271 __tmp.put_u16_le(self.hdg);
14272 if matches!(version, MavlinkVersion::V2) {
14273 let len = __tmp.len();
14274 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14275 } else {
14276 __tmp.len()
14277 }
14278 }
14279}
14280#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
14281#[doc = ""]
14282#[doc = "ID: 63"]
14283#[derive(Debug, Clone, PartialEq)]
14284#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14285#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14286#[cfg_attr(feature = "ts", derive(TS))]
14287#[cfg_attr(feature = "ts", ts(export))]
14288pub struct GLOBAL_POSITION_INT_COV_DATA {
14289 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14290 pub time_usec: u64,
14291 #[doc = "Latitude"]
14292 pub lat: i32,
14293 #[doc = "Longitude"]
14294 pub lon: i32,
14295 #[doc = "Altitude in meters above MSL"]
14296 pub alt: i32,
14297 #[doc = "Altitude above ground"]
14298 pub relative_alt: i32,
14299 #[doc = "Ground X Speed (Latitude)"]
14300 pub vx: f32,
14301 #[doc = "Ground Y Speed (Longitude)"]
14302 pub vy: f32,
14303 #[doc = "Ground Z Speed (Altitude)"]
14304 pub vz: f32,
14305 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
14306 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14307 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14308 pub covariance: [f32; 36],
14309 #[doc = "Class id of the estimator this estimate originated from."]
14310 pub estimator_type: MavEstimatorType,
14311}
14312impl GLOBAL_POSITION_INT_COV_DATA {
14313 pub const ENCODED_LEN: usize = 181usize;
14314 pub const DEFAULT: Self = Self {
14315 time_usec: 0_u64,
14316 lat: 0_i32,
14317 lon: 0_i32,
14318 alt: 0_i32,
14319 relative_alt: 0_i32,
14320 vx: 0.0_f32,
14321 vy: 0.0_f32,
14322 vz: 0.0_f32,
14323 covariance: [0.0_f32; 36usize],
14324 estimator_type: MavEstimatorType::DEFAULT,
14325 };
14326 #[cfg(feature = "arbitrary")]
14327 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14328 use arbitrary::{Arbitrary, Unstructured};
14329 let mut buf = [0u8; 1024];
14330 rng.fill_bytes(&mut buf);
14331 let mut unstructured = Unstructured::new(&buf);
14332 Self::arbitrary(&mut unstructured).unwrap_or_default()
14333 }
14334}
14335impl Default for GLOBAL_POSITION_INT_COV_DATA {
14336 fn default() -> Self {
14337 Self::DEFAULT.clone()
14338 }
14339}
14340impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
14341 type Message = MavMessage;
14342 const ID: u32 = 63u32;
14343 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
14344 const EXTRA_CRC: u8 = 119u8;
14345 const ENCODED_LEN: usize = 181usize;
14346 fn deser(
14347 _version: MavlinkVersion,
14348 __input: &[u8],
14349 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14350 let avail_len = __input.len();
14351 let mut payload_buf = [0; Self::ENCODED_LEN];
14352 let mut buf = if avail_len < Self::ENCODED_LEN {
14353 payload_buf[0..avail_len].copy_from_slice(__input);
14354 Bytes::new(&payload_buf)
14355 } else {
14356 Bytes::new(__input)
14357 };
14358 let mut __struct = Self::default();
14359 __struct.time_usec = buf.get_u64_le()?;
14360 __struct.lat = buf.get_i32_le()?;
14361 __struct.lon = buf.get_i32_le()?;
14362 __struct.alt = buf.get_i32_le()?;
14363 __struct.relative_alt = buf.get_i32_le()?;
14364 __struct.vx = buf.get_f32_le()?;
14365 __struct.vy = buf.get_f32_le()?;
14366 __struct.vz = buf.get_f32_le()?;
14367 for v in &mut __struct.covariance {
14368 let val = buf.get_f32_le()?;
14369 *v = val;
14370 }
14371 let tmp = buf.get_u8()?;
14372 __struct.estimator_type =
14373 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14374 enum_type: "MavEstimatorType",
14375 value: tmp as u64,
14376 })?;
14377 Ok(__struct)
14378 }
14379 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14380 let mut __tmp = BytesMut::new(bytes);
14381 #[allow(clippy::absurd_extreme_comparisons)]
14382 #[allow(unused_comparisons)]
14383 if __tmp.remaining() < Self::ENCODED_LEN {
14384 panic!(
14385 "buffer is too small (need {} bytes, but got {})",
14386 Self::ENCODED_LEN,
14387 __tmp.remaining(),
14388 )
14389 }
14390 __tmp.put_u64_le(self.time_usec);
14391 __tmp.put_i32_le(self.lat);
14392 __tmp.put_i32_le(self.lon);
14393 __tmp.put_i32_le(self.alt);
14394 __tmp.put_i32_le(self.relative_alt);
14395 __tmp.put_f32_le(self.vx);
14396 __tmp.put_f32_le(self.vy);
14397 __tmp.put_f32_le(self.vz);
14398 for val in &self.covariance {
14399 __tmp.put_f32_le(*val);
14400 }
14401 __tmp.put_u8(self.estimator_type as u8);
14402 if matches!(version, MavlinkVersion::V2) {
14403 let len = __tmp.len();
14404 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14405 } else {
14406 __tmp.len()
14407 }
14408 }
14409}
14410#[doc = "Global position/attitude estimate from a vision source."]
14411#[doc = ""]
14412#[doc = "ID: 101"]
14413#[derive(Debug, Clone, PartialEq)]
14414#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14415#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14416#[cfg_attr(feature = "ts", derive(TS))]
14417#[cfg_attr(feature = "ts", ts(export))]
14418pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14419 #[doc = "Timestamp (UNIX time or since system boot)"]
14420 pub usec: u64,
14421 #[doc = "Global X position"]
14422 pub x: f32,
14423 #[doc = "Global Y position"]
14424 pub y: f32,
14425 #[doc = "Global Z position"]
14426 pub z: f32,
14427 #[doc = "Roll angle"]
14428 pub roll: f32,
14429 #[doc = "Pitch angle"]
14430 pub pitch: f32,
14431 #[doc = "Yaw angle"]
14432 pub yaw: f32,
14433 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
14434 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14435 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14436 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14437 pub covariance: [f32; 21],
14438 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
14439 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14440 pub reset_counter: u8,
14441}
14442impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14443 pub const ENCODED_LEN: usize = 117usize;
14444 pub const DEFAULT: Self = Self {
14445 usec: 0_u64,
14446 x: 0.0_f32,
14447 y: 0.0_f32,
14448 z: 0.0_f32,
14449 roll: 0.0_f32,
14450 pitch: 0.0_f32,
14451 yaw: 0.0_f32,
14452 covariance: [0.0_f32; 21usize],
14453 reset_counter: 0_u8,
14454 };
14455 #[cfg(feature = "arbitrary")]
14456 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14457 use arbitrary::{Arbitrary, Unstructured};
14458 let mut buf = [0u8; 1024];
14459 rng.fill_bytes(&mut buf);
14460 let mut unstructured = Unstructured::new(&buf);
14461 Self::arbitrary(&mut unstructured).unwrap_or_default()
14462 }
14463}
14464impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14465 fn default() -> Self {
14466 Self::DEFAULT.clone()
14467 }
14468}
14469impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
14470 type Message = MavMessage;
14471 const ID: u32 = 101u32;
14472 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
14473 const EXTRA_CRC: u8 = 102u8;
14474 const ENCODED_LEN: usize = 117usize;
14475 fn deser(
14476 _version: MavlinkVersion,
14477 __input: &[u8],
14478 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14479 let avail_len = __input.len();
14480 let mut payload_buf = [0; Self::ENCODED_LEN];
14481 let mut buf = if avail_len < Self::ENCODED_LEN {
14482 payload_buf[0..avail_len].copy_from_slice(__input);
14483 Bytes::new(&payload_buf)
14484 } else {
14485 Bytes::new(__input)
14486 };
14487 let mut __struct = Self::default();
14488 __struct.usec = buf.get_u64_le()?;
14489 __struct.x = buf.get_f32_le()?;
14490 __struct.y = buf.get_f32_le()?;
14491 __struct.z = buf.get_f32_le()?;
14492 __struct.roll = buf.get_f32_le()?;
14493 __struct.pitch = buf.get_f32_le()?;
14494 __struct.yaw = buf.get_f32_le()?;
14495 for v in &mut __struct.covariance {
14496 let val = buf.get_f32_le()?;
14497 *v = val;
14498 }
14499 __struct.reset_counter = buf.get_u8()?;
14500 Ok(__struct)
14501 }
14502 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14503 let mut __tmp = BytesMut::new(bytes);
14504 #[allow(clippy::absurd_extreme_comparisons)]
14505 #[allow(unused_comparisons)]
14506 if __tmp.remaining() < Self::ENCODED_LEN {
14507 panic!(
14508 "buffer is too small (need {} bytes, but got {})",
14509 Self::ENCODED_LEN,
14510 __tmp.remaining(),
14511 )
14512 }
14513 __tmp.put_u64_le(self.usec);
14514 __tmp.put_f32_le(self.x);
14515 __tmp.put_f32_le(self.y);
14516 __tmp.put_f32_le(self.z);
14517 __tmp.put_f32_le(self.roll);
14518 __tmp.put_f32_le(self.pitch);
14519 __tmp.put_f32_le(self.yaw);
14520 if matches!(version, MavlinkVersion::V2) {
14521 for val in &self.covariance {
14522 __tmp.put_f32_le(*val);
14523 }
14524 __tmp.put_u8(self.reset_counter);
14525 let len = __tmp.len();
14526 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14527 } else {
14528 __tmp.len()
14529 }
14530 }
14531}
14532#[doc = "Second GPS data."]
14533#[doc = ""]
14534#[doc = "ID: 124"]
14535#[derive(Debug, Clone, PartialEq)]
14536#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14537#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14538#[cfg_attr(feature = "ts", derive(TS))]
14539#[cfg_attr(feature = "ts", ts(export))]
14540pub struct GPS2_RAW_DATA {
14541 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14542 pub time_usec: u64,
14543 #[doc = "Latitude (WGS84)"]
14544 pub lat: i32,
14545 #[doc = "Longitude (WGS84)"]
14546 pub lon: i32,
14547 #[doc = "Altitude (MSL). Positive for up."]
14548 pub alt: i32,
14549 #[doc = "Age of DGPS info"]
14550 pub dgps_age: u32,
14551 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14552 pub eph: u16,
14553 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14554 pub epv: u16,
14555 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14556 pub vel: u16,
14557 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14558 pub cog: u16,
14559 #[doc = "GPS fix type."]
14560 pub fix_type: GpsFixType,
14561 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14562 pub satellites_visible: u8,
14563 #[doc = "Number of DGPS satellites"]
14564 pub dgps_numch: u8,
14565 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14566 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14567 pub yaw: u16,
14568 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14569 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14570 pub alt_ellipsoid: i32,
14571 #[doc = "Position uncertainty."]
14572 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14573 pub h_acc: u32,
14574 #[doc = "Altitude uncertainty."]
14575 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14576 pub v_acc: u32,
14577 #[doc = "Speed uncertainty."]
14578 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14579 pub vel_acc: u32,
14580 #[doc = "Heading / track uncertainty"]
14581 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14582 pub hdg_acc: u32,
14583}
14584impl GPS2_RAW_DATA {
14585 pub const ENCODED_LEN: usize = 57usize;
14586 pub const DEFAULT: Self = Self {
14587 time_usec: 0_u64,
14588 lat: 0_i32,
14589 lon: 0_i32,
14590 alt: 0_i32,
14591 dgps_age: 0_u32,
14592 eph: 0_u16,
14593 epv: 0_u16,
14594 vel: 0_u16,
14595 cog: 0_u16,
14596 fix_type: GpsFixType::DEFAULT,
14597 satellites_visible: 0_u8,
14598 dgps_numch: 0_u8,
14599 yaw: 0_u16,
14600 alt_ellipsoid: 0_i32,
14601 h_acc: 0_u32,
14602 v_acc: 0_u32,
14603 vel_acc: 0_u32,
14604 hdg_acc: 0_u32,
14605 };
14606 #[cfg(feature = "arbitrary")]
14607 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14608 use arbitrary::{Arbitrary, Unstructured};
14609 let mut buf = [0u8; 1024];
14610 rng.fill_bytes(&mut buf);
14611 let mut unstructured = Unstructured::new(&buf);
14612 Self::arbitrary(&mut unstructured).unwrap_or_default()
14613 }
14614}
14615impl Default for GPS2_RAW_DATA {
14616 fn default() -> Self {
14617 Self::DEFAULT.clone()
14618 }
14619}
14620impl MessageData for GPS2_RAW_DATA {
14621 type Message = MavMessage;
14622 const ID: u32 = 124u32;
14623 const NAME: &'static str = "GPS2_RAW";
14624 const EXTRA_CRC: u8 = 87u8;
14625 const ENCODED_LEN: usize = 57usize;
14626 fn deser(
14627 _version: MavlinkVersion,
14628 __input: &[u8],
14629 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14630 let avail_len = __input.len();
14631 let mut payload_buf = [0; Self::ENCODED_LEN];
14632 let mut buf = if avail_len < Self::ENCODED_LEN {
14633 payload_buf[0..avail_len].copy_from_slice(__input);
14634 Bytes::new(&payload_buf)
14635 } else {
14636 Bytes::new(__input)
14637 };
14638 let mut __struct = Self::default();
14639 __struct.time_usec = buf.get_u64_le()?;
14640 __struct.lat = buf.get_i32_le()?;
14641 __struct.lon = buf.get_i32_le()?;
14642 __struct.alt = buf.get_i32_le()?;
14643 __struct.dgps_age = buf.get_u32_le()?;
14644 __struct.eph = buf.get_u16_le()?;
14645 __struct.epv = buf.get_u16_le()?;
14646 __struct.vel = buf.get_u16_le()?;
14647 __struct.cog = buf.get_u16_le()?;
14648 let tmp = buf.get_u8()?;
14649 __struct.fix_type =
14650 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14651 enum_type: "GpsFixType",
14652 value: tmp as u64,
14653 })?;
14654 __struct.satellites_visible = buf.get_u8()?;
14655 __struct.dgps_numch = buf.get_u8()?;
14656 __struct.yaw = buf.get_u16_le()?;
14657 __struct.alt_ellipsoid = buf.get_i32_le()?;
14658 __struct.h_acc = buf.get_u32_le()?;
14659 __struct.v_acc = buf.get_u32_le()?;
14660 __struct.vel_acc = buf.get_u32_le()?;
14661 __struct.hdg_acc = buf.get_u32_le()?;
14662 Ok(__struct)
14663 }
14664 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14665 let mut __tmp = BytesMut::new(bytes);
14666 #[allow(clippy::absurd_extreme_comparisons)]
14667 #[allow(unused_comparisons)]
14668 if __tmp.remaining() < Self::ENCODED_LEN {
14669 panic!(
14670 "buffer is too small (need {} bytes, but got {})",
14671 Self::ENCODED_LEN,
14672 __tmp.remaining(),
14673 )
14674 }
14675 __tmp.put_u64_le(self.time_usec);
14676 __tmp.put_i32_le(self.lat);
14677 __tmp.put_i32_le(self.lon);
14678 __tmp.put_i32_le(self.alt);
14679 __tmp.put_u32_le(self.dgps_age);
14680 __tmp.put_u16_le(self.eph);
14681 __tmp.put_u16_le(self.epv);
14682 __tmp.put_u16_le(self.vel);
14683 __tmp.put_u16_le(self.cog);
14684 __tmp.put_u8(self.fix_type as u8);
14685 __tmp.put_u8(self.satellites_visible);
14686 __tmp.put_u8(self.dgps_numch);
14687 if matches!(version, MavlinkVersion::V2) {
14688 __tmp.put_u16_le(self.yaw);
14689 __tmp.put_i32_le(self.alt_ellipsoid);
14690 __tmp.put_u32_le(self.h_acc);
14691 __tmp.put_u32_le(self.v_acc);
14692 __tmp.put_u32_le(self.vel_acc);
14693 __tmp.put_u32_le(self.hdg_acc);
14694 let len = __tmp.len();
14695 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14696 } else {
14697 __tmp.len()
14698 }
14699 }
14700}
14701#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14702#[doc = ""]
14703#[doc = "ID: 128"]
14704#[derive(Debug, Clone, PartialEq)]
14705#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14706#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14707#[cfg_attr(feature = "ts", derive(TS))]
14708#[cfg_attr(feature = "ts", ts(export))]
14709pub struct GPS2_RTK_DATA {
14710 #[doc = "Time since boot of last baseline message received."]
14711 pub time_last_baseline_ms: u32,
14712 #[doc = "GPS Time of Week of last baseline"]
14713 pub tow: u32,
14714 #[doc = "Current baseline in ECEF x or NED north component."]
14715 pub baseline_a_mm: i32,
14716 #[doc = "Current baseline in ECEF y or NED east component."]
14717 pub baseline_b_mm: i32,
14718 #[doc = "Current baseline in ECEF z or NED down component."]
14719 pub baseline_c_mm: i32,
14720 #[doc = "Current estimate of baseline accuracy."]
14721 pub accuracy: u32,
14722 #[doc = "Current number of integer ambiguity hypotheses."]
14723 pub iar_num_hypotheses: i32,
14724 #[doc = "GPS Week Number of last baseline"]
14725 pub wn: u16,
14726 #[doc = "Identification of connected RTK receiver."]
14727 pub rtk_receiver_id: u8,
14728 #[doc = "GPS-specific health report for RTK data."]
14729 pub rtk_health: u8,
14730 #[doc = "Rate of baseline messages being received by GPS"]
14731 pub rtk_rate: u8,
14732 #[doc = "Current number of sats used for RTK calculation."]
14733 pub nsats: u8,
14734 #[doc = "Coordinate system of baseline"]
14735 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14736}
14737impl GPS2_RTK_DATA {
14738 pub const ENCODED_LEN: usize = 35usize;
14739 pub const DEFAULT: Self = Self {
14740 time_last_baseline_ms: 0_u32,
14741 tow: 0_u32,
14742 baseline_a_mm: 0_i32,
14743 baseline_b_mm: 0_i32,
14744 baseline_c_mm: 0_i32,
14745 accuracy: 0_u32,
14746 iar_num_hypotheses: 0_i32,
14747 wn: 0_u16,
14748 rtk_receiver_id: 0_u8,
14749 rtk_health: 0_u8,
14750 rtk_rate: 0_u8,
14751 nsats: 0_u8,
14752 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14753 };
14754 #[cfg(feature = "arbitrary")]
14755 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14756 use arbitrary::{Arbitrary, Unstructured};
14757 let mut buf = [0u8; 1024];
14758 rng.fill_bytes(&mut buf);
14759 let mut unstructured = Unstructured::new(&buf);
14760 Self::arbitrary(&mut unstructured).unwrap_or_default()
14761 }
14762}
14763impl Default for GPS2_RTK_DATA {
14764 fn default() -> Self {
14765 Self::DEFAULT.clone()
14766 }
14767}
14768impl MessageData for GPS2_RTK_DATA {
14769 type Message = MavMessage;
14770 const ID: u32 = 128u32;
14771 const NAME: &'static str = "GPS2_RTK";
14772 const EXTRA_CRC: u8 = 226u8;
14773 const ENCODED_LEN: usize = 35usize;
14774 fn deser(
14775 _version: MavlinkVersion,
14776 __input: &[u8],
14777 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14778 let avail_len = __input.len();
14779 let mut payload_buf = [0; Self::ENCODED_LEN];
14780 let mut buf = if avail_len < Self::ENCODED_LEN {
14781 payload_buf[0..avail_len].copy_from_slice(__input);
14782 Bytes::new(&payload_buf)
14783 } else {
14784 Bytes::new(__input)
14785 };
14786 let mut __struct = Self::default();
14787 __struct.time_last_baseline_ms = buf.get_u32_le()?;
14788 __struct.tow = buf.get_u32_le()?;
14789 __struct.baseline_a_mm = buf.get_i32_le()?;
14790 __struct.baseline_b_mm = buf.get_i32_le()?;
14791 __struct.baseline_c_mm = buf.get_i32_le()?;
14792 __struct.accuracy = buf.get_u32_le()?;
14793 __struct.iar_num_hypotheses = buf.get_i32_le()?;
14794 __struct.wn = buf.get_u16_le()?;
14795 __struct.rtk_receiver_id = buf.get_u8()?;
14796 __struct.rtk_health = buf.get_u8()?;
14797 __struct.rtk_rate = buf.get_u8()?;
14798 __struct.nsats = buf.get_u8()?;
14799 let tmp = buf.get_u8()?;
14800 __struct.baseline_coords_type =
14801 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14802 enum_type: "RtkBaselineCoordinateSystem",
14803 value: tmp as u64,
14804 })?;
14805 Ok(__struct)
14806 }
14807 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14808 let mut __tmp = BytesMut::new(bytes);
14809 #[allow(clippy::absurd_extreme_comparisons)]
14810 #[allow(unused_comparisons)]
14811 if __tmp.remaining() < Self::ENCODED_LEN {
14812 panic!(
14813 "buffer is too small (need {} bytes, but got {})",
14814 Self::ENCODED_LEN,
14815 __tmp.remaining(),
14816 )
14817 }
14818 __tmp.put_u32_le(self.time_last_baseline_ms);
14819 __tmp.put_u32_le(self.tow);
14820 __tmp.put_i32_le(self.baseline_a_mm);
14821 __tmp.put_i32_le(self.baseline_b_mm);
14822 __tmp.put_i32_le(self.baseline_c_mm);
14823 __tmp.put_u32_le(self.accuracy);
14824 __tmp.put_i32_le(self.iar_num_hypotheses);
14825 __tmp.put_u16_le(self.wn);
14826 __tmp.put_u8(self.rtk_receiver_id);
14827 __tmp.put_u8(self.rtk_health);
14828 __tmp.put_u8(self.rtk_rate);
14829 __tmp.put_u8(self.nsats);
14830 __tmp.put_u8(self.baseline_coords_type as u8);
14831 if matches!(version, MavlinkVersion::V2) {
14832 let len = __tmp.len();
14833 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14834 } else {
14835 __tmp.len()
14836 }
14837 }
14838}
14839#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
14840#[doc = ""]
14841#[doc = "ID: 49"]
14842#[derive(Debug, Clone, PartialEq)]
14843#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14844#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14845#[cfg_attr(feature = "ts", derive(TS))]
14846#[cfg_attr(feature = "ts", ts(export))]
14847pub struct GPS_GLOBAL_ORIGIN_DATA {
14848 #[doc = "Latitude (WGS84)"]
14849 pub latitude: i32,
14850 #[doc = "Longitude (WGS84)"]
14851 pub longitude: i32,
14852 #[doc = "Altitude (MSL). Positive for up."]
14853 pub altitude: i32,
14854 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14855 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14856 pub time_usec: u64,
14857}
14858impl GPS_GLOBAL_ORIGIN_DATA {
14859 pub const ENCODED_LEN: usize = 20usize;
14860 pub const DEFAULT: Self = Self {
14861 latitude: 0_i32,
14862 longitude: 0_i32,
14863 altitude: 0_i32,
14864 time_usec: 0_u64,
14865 };
14866 #[cfg(feature = "arbitrary")]
14867 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14868 use arbitrary::{Arbitrary, Unstructured};
14869 let mut buf = [0u8; 1024];
14870 rng.fill_bytes(&mut buf);
14871 let mut unstructured = Unstructured::new(&buf);
14872 Self::arbitrary(&mut unstructured).unwrap_or_default()
14873 }
14874}
14875impl Default for GPS_GLOBAL_ORIGIN_DATA {
14876 fn default() -> Self {
14877 Self::DEFAULT.clone()
14878 }
14879}
14880impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
14881 type Message = MavMessage;
14882 const ID: u32 = 49u32;
14883 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
14884 const EXTRA_CRC: u8 = 39u8;
14885 const ENCODED_LEN: usize = 20usize;
14886 fn deser(
14887 _version: MavlinkVersion,
14888 __input: &[u8],
14889 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14890 let avail_len = __input.len();
14891 let mut payload_buf = [0; Self::ENCODED_LEN];
14892 let mut buf = if avail_len < Self::ENCODED_LEN {
14893 payload_buf[0..avail_len].copy_from_slice(__input);
14894 Bytes::new(&payload_buf)
14895 } else {
14896 Bytes::new(__input)
14897 };
14898 let mut __struct = Self::default();
14899 __struct.latitude = buf.get_i32_le()?;
14900 __struct.longitude = buf.get_i32_le()?;
14901 __struct.altitude = buf.get_i32_le()?;
14902 __struct.time_usec = buf.get_u64_le()?;
14903 Ok(__struct)
14904 }
14905 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14906 let mut __tmp = BytesMut::new(bytes);
14907 #[allow(clippy::absurd_extreme_comparisons)]
14908 #[allow(unused_comparisons)]
14909 if __tmp.remaining() < Self::ENCODED_LEN {
14910 panic!(
14911 "buffer is too small (need {} bytes, but got {})",
14912 Self::ENCODED_LEN,
14913 __tmp.remaining(),
14914 )
14915 }
14916 __tmp.put_i32_le(self.latitude);
14917 __tmp.put_i32_le(self.longitude);
14918 __tmp.put_i32_le(self.altitude);
14919 if matches!(version, MavlinkVersion::V2) {
14920 __tmp.put_u64_le(self.time_usec);
14921 let len = __tmp.len();
14922 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14923 } else {
14924 __tmp.len()
14925 }
14926 }
14927}
14928#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
14929#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
14930#[doc = ""]
14931#[doc = "ID: 123"]
14932#[derive(Debug, Clone, PartialEq)]
14933#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14934#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14935#[cfg_attr(feature = "ts", derive(TS))]
14936#[cfg_attr(feature = "ts", ts(export))]
14937pub struct GPS_INJECT_DATA_DATA {
14938 #[doc = "System ID"]
14939 pub target_system: u8,
14940 #[doc = "Component ID"]
14941 pub target_component: u8,
14942 #[doc = "Data length"]
14943 pub len: u8,
14944 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
14945 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14946 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
14947 pub data: [u8; 110],
14948}
14949impl GPS_INJECT_DATA_DATA {
14950 pub const ENCODED_LEN: usize = 113usize;
14951 pub const DEFAULT: Self = Self {
14952 target_system: 0_u8,
14953 target_component: 0_u8,
14954 len: 0_u8,
14955 data: [0_u8; 110usize],
14956 };
14957 #[cfg(feature = "arbitrary")]
14958 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14959 use arbitrary::{Arbitrary, Unstructured};
14960 let mut buf = [0u8; 1024];
14961 rng.fill_bytes(&mut buf);
14962 let mut unstructured = Unstructured::new(&buf);
14963 Self::arbitrary(&mut unstructured).unwrap_or_default()
14964 }
14965}
14966impl Default for GPS_INJECT_DATA_DATA {
14967 fn default() -> Self {
14968 Self::DEFAULT.clone()
14969 }
14970}
14971impl MessageData for GPS_INJECT_DATA_DATA {
14972 type Message = MavMessage;
14973 const ID: u32 = 123u32;
14974 const NAME: &'static str = "GPS_INJECT_DATA";
14975 const EXTRA_CRC: u8 = 250u8;
14976 const ENCODED_LEN: usize = 113usize;
14977 fn deser(
14978 _version: MavlinkVersion,
14979 __input: &[u8],
14980 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14981 let avail_len = __input.len();
14982 let mut payload_buf = [0; Self::ENCODED_LEN];
14983 let mut buf = if avail_len < Self::ENCODED_LEN {
14984 payload_buf[0..avail_len].copy_from_slice(__input);
14985 Bytes::new(&payload_buf)
14986 } else {
14987 Bytes::new(__input)
14988 };
14989 let mut __struct = Self::default();
14990 __struct.target_system = buf.get_u8()?;
14991 __struct.target_component = buf.get_u8()?;
14992 __struct.len = buf.get_u8()?;
14993 for v in &mut __struct.data {
14994 let val = buf.get_u8()?;
14995 *v = val;
14996 }
14997 Ok(__struct)
14998 }
14999 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15000 let mut __tmp = BytesMut::new(bytes);
15001 #[allow(clippy::absurd_extreme_comparisons)]
15002 #[allow(unused_comparisons)]
15003 if __tmp.remaining() < Self::ENCODED_LEN {
15004 panic!(
15005 "buffer is too small (need {} bytes, but got {})",
15006 Self::ENCODED_LEN,
15007 __tmp.remaining(),
15008 )
15009 }
15010 __tmp.put_u8(self.target_system);
15011 __tmp.put_u8(self.target_component);
15012 __tmp.put_u8(self.len);
15013 for val in &self.data {
15014 __tmp.put_u8(*val);
15015 }
15016 if matches!(version, MavlinkVersion::V2) {
15017 let len = __tmp.len();
15018 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15019 } else {
15020 __tmp.len()
15021 }
15022 }
15023}
15024#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
15025#[doc = ""]
15026#[doc = "ID: 232"]
15027#[derive(Debug, Clone, PartialEq)]
15028#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15029#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15030#[cfg_attr(feature = "ts", derive(TS))]
15031#[cfg_attr(feature = "ts", ts(export))]
15032pub struct GPS_INPUT_DATA {
15033 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15034 pub time_usec: u64,
15035 #[doc = "GPS time (from start of GPS week)"]
15036 pub time_week_ms: u32,
15037 #[doc = "Latitude (WGS84)"]
15038 pub lat: i32,
15039 #[doc = "Longitude (WGS84)"]
15040 pub lon: i32,
15041 #[doc = "Altitude (MSL). Positive for up."]
15042 pub alt: f32,
15043 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
15044 pub hdop: f32,
15045 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
15046 pub vdop: f32,
15047 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
15048 pub vn: f32,
15049 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
15050 pub ve: f32,
15051 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
15052 pub vd: f32,
15053 #[doc = "GPS speed accuracy"]
15054 pub speed_accuracy: f32,
15055 #[doc = "GPS horizontal accuracy"]
15056 pub horiz_accuracy: f32,
15057 #[doc = "GPS vertical accuracy"]
15058 pub vert_accuracy: f32,
15059 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
15060 pub ignore_flags: GpsInputIgnoreFlags,
15061 #[doc = "GPS week number"]
15062 pub time_week: u16,
15063 #[doc = "ID of the GPS for multiple GPS inputs"]
15064 pub gps_id: u8,
15065 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
15066 pub fix_type: u8,
15067 #[doc = "Number of satellites visible."]
15068 pub satellites_visible: u8,
15069 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
15070 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15071 pub yaw: u16,
15072}
15073impl GPS_INPUT_DATA {
15074 pub const ENCODED_LEN: usize = 65usize;
15075 pub const DEFAULT: Self = Self {
15076 time_usec: 0_u64,
15077 time_week_ms: 0_u32,
15078 lat: 0_i32,
15079 lon: 0_i32,
15080 alt: 0.0_f32,
15081 hdop: 0.0_f32,
15082 vdop: 0.0_f32,
15083 vn: 0.0_f32,
15084 ve: 0.0_f32,
15085 vd: 0.0_f32,
15086 speed_accuracy: 0.0_f32,
15087 horiz_accuracy: 0.0_f32,
15088 vert_accuracy: 0.0_f32,
15089 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
15090 time_week: 0_u16,
15091 gps_id: 0_u8,
15092 fix_type: 0_u8,
15093 satellites_visible: 0_u8,
15094 yaw: 0_u16,
15095 };
15096 #[cfg(feature = "arbitrary")]
15097 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15098 use arbitrary::{Arbitrary, Unstructured};
15099 let mut buf = [0u8; 1024];
15100 rng.fill_bytes(&mut buf);
15101 let mut unstructured = Unstructured::new(&buf);
15102 Self::arbitrary(&mut unstructured).unwrap_or_default()
15103 }
15104}
15105impl Default for GPS_INPUT_DATA {
15106 fn default() -> Self {
15107 Self::DEFAULT.clone()
15108 }
15109}
15110impl MessageData for GPS_INPUT_DATA {
15111 type Message = MavMessage;
15112 const ID: u32 = 232u32;
15113 const NAME: &'static str = "GPS_INPUT";
15114 const EXTRA_CRC: u8 = 151u8;
15115 const ENCODED_LEN: usize = 65usize;
15116 fn deser(
15117 _version: MavlinkVersion,
15118 __input: &[u8],
15119 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15120 let avail_len = __input.len();
15121 let mut payload_buf = [0; Self::ENCODED_LEN];
15122 let mut buf = if avail_len < Self::ENCODED_LEN {
15123 payload_buf[0..avail_len].copy_from_slice(__input);
15124 Bytes::new(&payload_buf)
15125 } else {
15126 Bytes::new(__input)
15127 };
15128 let mut __struct = Self::default();
15129 __struct.time_usec = buf.get_u64_le()?;
15130 __struct.time_week_ms = buf.get_u32_le()?;
15131 __struct.lat = buf.get_i32_le()?;
15132 __struct.lon = buf.get_i32_le()?;
15133 __struct.alt = buf.get_f32_le()?;
15134 __struct.hdop = buf.get_f32_le()?;
15135 __struct.vdop = buf.get_f32_le()?;
15136 __struct.vn = buf.get_f32_le()?;
15137 __struct.ve = buf.get_f32_le()?;
15138 __struct.vd = buf.get_f32_le()?;
15139 __struct.speed_accuracy = buf.get_f32_le()?;
15140 __struct.horiz_accuracy = buf.get_f32_le()?;
15141 __struct.vert_accuracy = buf.get_f32_le()?;
15142 let tmp = buf.get_u16_le()?;
15143 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
15144 tmp as <GpsInputIgnoreFlags as Flags>::Bits,
15145 )
15146 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15147 flag_type: "GpsInputIgnoreFlags",
15148 value: tmp as u64,
15149 })?;
15150 __struct.time_week = buf.get_u16_le()?;
15151 __struct.gps_id = buf.get_u8()?;
15152 __struct.fix_type = buf.get_u8()?;
15153 __struct.satellites_visible = buf.get_u8()?;
15154 __struct.yaw = buf.get_u16_le()?;
15155 Ok(__struct)
15156 }
15157 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15158 let mut __tmp = BytesMut::new(bytes);
15159 #[allow(clippy::absurd_extreme_comparisons)]
15160 #[allow(unused_comparisons)]
15161 if __tmp.remaining() < Self::ENCODED_LEN {
15162 panic!(
15163 "buffer is too small (need {} bytes, but got {})",
15164 Self::ENCODED_LEN,
15165 __tmp.remaining(),
15166 )
15167 }
15168 __tmp.put_u64_le(self.time_usec);
15169 __tmp.put_u32_le(self.time_week_ms);
15170 __tmp.put_i32_le(self.lat);
15171 __tmp.put_i32_le(self.lon);
15172 __tmp.put_f32_le(self.alt);
15173 __tmp.put_f32_le(self.hdop);
15174 __tmp.put_f32_le(self.vdop);
15175 __tmp.put_f32_le(self.vn);
15176 __tmp.put_f32_le(self.ve);
15177 __tmp.put_f32_le(self.vd);
15178 __tmp.put_f32_le(self.speed_accuracy);
15179 __tmp.put_f32_le(self.horiz_accuracy);
15180 __tmp.put_f32_le(self.vert_accuracy);
15181 __tmp.put_u16_le(self.ignore_flags.bits() as u16);
15182 __tmp.put_u16_le(self.time_week);
15183 __tmp.put_u8(self.gps_id);
15184 __tmp.put_u8(self.fix_type);
15185 __tmp.put_u8(self.satellites_visible);
15186 if matches!(version, MavlinkVersion::V2) {
15187 __tmp.put_u16_le(self.yaw);
15188 let len = __tmp.len();
15189 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15190 } else {
15191 __tmp.len()
15192 }
15193 }
15194}
15195#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
15196#[doc = ""]
15197#[doc = "ID: 24"]
15198#[derive(Debug, Clone, PartialEq)]
15199#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15200#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15201#[cfg_attr(feature = "ts", derive(TS))]
15202#[cfg_attr(feature = "ts", ts(export))]
15203pub struct GPS_RAW_INT_DATA {
15204 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15205 pub time_usec: u64,
15206 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
15207 pub lat: i32,
15208 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
15209 pub lon: i32,
15210 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
15211 pub alt: i32,
15212 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15213 pub eph: u16,
15214 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15215 pub epv: u16,
15216 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
15217 pub vel: u16,
15218 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
15219 pub cog: u16,
15220 #[doc = "GPS fix type."]
15221 pub fix_type: GpsFixType,
15222 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15223 pub satellites_visible: u8,
15224 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
15225 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15226 pub alt_ellipsoid: i32,
15227 #[doc = "Position uncertainty."]
15228 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15229 pub h_acc: u32,
15230 #[doc = "Altitude uncertainty."]
15231 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15232 pub v_acc: u32,
15233 #[doc = "Speed uncertainty."]
15234 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15235 pub vel_acc: u32,
15236 #[doc = "Heading / track uncertainty"]
15237 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15238 pub hdg_acc: u32,
15239 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
15240 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15241 pub yaw: u16,
15242}
15243impl GPS_RAW_INT_DATA {
15244 pub const ENCODED_LEN: usize = 52usize;
15245 pub const DEFAULT: Self = Self {
15246 time_usec: 0_u64,
15247 lat: 0_i32,
15248 lon: 0_i32,
15249 alt: 0_i32,
15250 eph: 0_u16,
15251 epv: 0_u16,
15252 vel: 0_u16,
15253 cog: 0_u16,
15254 fix_type: GpsFixType::DEFAULT,
15255 satellites_visible: 0_u8,
15256 alt_ellipsoid: 0_i32,
15257 h_acc: 0_u32,
15258 v_acc: 0_u32,
15259 vel_acc: 0_u32,
15260 hdg_acc: 0_u32,
15261 yaw: 0_u16,
15262 };
15263 #[cfg(feature = "arbitrary")]
15264 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15265 use arbitrary::{Arbitrary, Unstructured};
15266 let mut buf = [0u8; 1024];
15267 rng.fill_bytes(&mut buf);
15268 let mut unstructured = Unstructured::new(&buf);
15269 Self::arbitrary(&mut unstructured).unwrap_or_default()
15270 }
15271}
15272impl Default for GPS_RAW_INT_DATA {
15273 fn default() -> Self {
15274 Self::DEFAULT.clone()
15275 }
15276}
15277impl MessageData for GPS_RAW_INT_DATA {
15278 type Message = MavMessage;
15279 const ID: u32 = 24u32;
15280 const NAME: &'static str = "GPS_RAW_INT";
15281 const EXTRA_CRC: u8 = 24u8;
15282 const ENCODED_LEN: usize = 52usize;
15283 fn deser(
15284 _version: MavlinkVersion,
15285 __input: &[u8],
15286 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15287 let avail_len = __input.len();
15288 let mut payload_buf = [0; Self::ENCODED_LEN];
15289 let mut buf = if avail_len < Self::ENCODED_LEN {
15290 payload_buf[0..avail_len].copy_from_slice(__input);
15291 Bytes::new(&payload_buf)
15292 } else {
15293 Bytes::new(__input)
15294 };
15295 let mut __struct = Self::default();
15296 __struct.time_usec = buf.get_u64_le()?;
15297 __struct.lat = buf.get_i32_le()?;
15298 __struct.lon = buf.get_i32_le()?;
15299 __struct.alt = buf.get_i32_le()?;
15300 __struct.eph = buf.get_u16_le()?;
15301 __struct.epv = buf.get_u16_le()?;
15302 __struct.vel = buf.get_u16_le()?;
15303 __struct.cog = buf.get_u16_le()?;
15304 let tmp = buf.get_u8()?;
15305 __struct.fix_type =
15306 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15307 enum_type: "GpsFixType",
15308 value: tmp as u64,
15309 })?;
15310 __struct.satellites_visible = buf.get_u8()?;
15311 __struct.alt_ellipsoid = buf.get_i32_le()?;
15312 __struct.h_acc = buf.get_u32_le()?;
15313 __struct.v_acc = buf.get_u32_le()?;
15314 __struct.vel_acc = buf.get_u32_le()?;
15315 __struct.hdg_acc = buf.get_u32_le()?;
15316 __struct.yaw = buf.get_u16_le()?;
15317 Ok(__struct)
15318 }
15319 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15320 let mut __tmp = BytesMut::new(bytes);
15321 #[allow(clippy::absurd_extreme_comparisons)]
15322 #[allow(unused_comparisons)]
15323 if __tmp.remaining() < Self::ENCODED_LEN {
15324 panic!(
15325 "buffer is too small (need {} bytes, but got {})",
15326 Self::ENCODED_LEN,
15327 __tmp.remaining(),
15328 )
15329 }
15330 __tmp.put_u64_le(self.time_usec);
15331 __tmp.put_i32_le(self.lat);
15332 __tmp.put_i32_le(self.lon);
15333 __tmp.put_i32_le(self.alt);
15334 __tmp.put_u16_le(self.eph);
15335 __tmp.put_u16_le(self.epv);
15336 __tmp.put_u16_le(self.vel);
15337 __tmp.put_u16_le(self.cog);
15338 __tmp.put_u8(self.fix_type as u8);
15339 __tmp.put_u8(self.satellites_visible);
15340 if matches!(version, MavlinkVersion::V2) {
15341 __tmp.put_i32_le(self.alt_ellipsoid);
15342 __tmp.put_u32_le(self.h_acc);
15343 __tmp.put_u32_le(self.v_acc);
15344 __tmp.put_u32_le(self.vel_acc);
15345 __tmp.put_u32_le(self.hdg_acc);
15346 __tmp.put_u16_le(self.yaw);
15347 let len = __tmp.len();
15348 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15349 } else {
15350 __tmp.len()
15351 }
15352 }
15353}
15354#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
15355#[doc = ""]
15356#[doc = "ID: 233"]
15357#[derive(Debug, Clone, PartialEq)]
15358#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15359#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15360#[cfg_attr(feature = "ts", derive(TS))]
15361#[cfg_attr(feature = "ts", ts(export))]
15362pub struct GPS_RTCM_DATA_DATA {
15363 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
15364 pub flags: u8,
15365 #[doc = "data length"]
15366 pub len: u8,
15367 #[doc = "RTCM message (may be fragmented)"]
15368 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15369 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15370 pub data: [u8; 180],
15371}
15372impl GPS_RTCM_DATA_DATA {
15373 pub const ENCODED_LEN: usize = 182usize;
15374 pub const DEFAULT: Self = Self {
15375 flags: 0_u8,
15376 len: 0_u8,
15377 data: [0_u8; 180usize],
15378 };
15379 #[cfg(feature = "arbitrary")]
15380 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15381 use arbitrary::{Arbitrary, Unstructured};
15382 let mut buf = [0u8; 1024];
15383 rng.fill_bytes(&mut buf);
15384 let mut unstructured = Unstructured::new(&buf);
15385 Self::arbitrary(&mut unstructured).unwrap_or_default()
15386 }
15387}
15388impl Default for GPS_RTCM_DATA_DATA {
15389 fn default() -> Self {
15390 Self::DEFAULT.clone()
15391 }
15392}
15393impl MessageData for GPS_RTCM_DATA_DATA {
15394 type Message = MavMessage;
15395 const ID: u32 = 233u32;
15396 const NAME: &'static str = "GPS_RTCM_DATA";
15397 const EXTRA_CRC: u8 = 35u8;
15398 const ENCODED_LEN: usize = 182usize;
15399 fn deser(
15400 _version: MavlinkVersion,
15401 __input: &[u8],
15402 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15403 let avail_len = __input.len();
15404 let mut payload_buf = [0; Self::ENCODED_LEN];
15405 let mut buf = if avail_len < Self::ENCODED_LEN {
15406 payload_buf[0..avail_len].copy_from_slice(__input);
15407 Bytes::new(&payload_buf)
15408 } else {
15409 Bytes::new(__input)
15410 };
15411 let mut __struct = Self::default();
15412 __struct.flags = buf.get_u8()?;
15413 __struct.len = buf.get_u8()?;
15414 for v in &mut __struct.data {
15415 let val = buf.get_u8()?;
15416 *v = val;
15417 }
15418 Ok(__struct)
15419 }
15420 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15421 let mut __tmp = BytesMut::new(bytes);
15422 #[allow(clippy::absurd_extreme_comparisons)]
15423 #[allow(unused_comparisons)]
15424 if __tmp.remaining() < Self::ENCODED_LEN {
15425 panic!(
15426 "buffer is too small (need {} bytes, but got {})",
15427 Self::ENCODED_LEN,
15428 __tmp.remaining(),
15429 )
15430 }
15431 __tmp.put_u8(self.flags);
15432 __tmp.put_u8(self.len);
15433 for val in &self.data {
15434 __tmp.put_u8(*val);
15435 }
15436 if matches!(version, MavlinkVersion::V2) {
15437 let len = __tmp.len();
15438 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15439 } else {
15440 __tmp.len()
15441 }
15442 }
15443}
15444#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
15445#[doc = ""]
15446#[doc = "ID: 127"]
15447#[derive(Debug, Clone, PartialEq)]
15448#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15449#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15450#[cfg_attr(feature = "ts", derive(TS))]
15451#[cfg_attr(feature = "ts", ts(export))]
15452pub struct GPS_RTK_DATA {
15453 #[doc = "Time since boot of last baseline message received."]
15454 pub time_last_baseline_ms: u32,
15455 #[doc = "GPS Time of Week of last baseline"]
15456 pub tow: u32,
15457 #[doc = "Current baseline in ECEF x or NED north component."]
15458 pub baseline_a_mm: i32,
15459 #[doc = "Current baseline in ECEF y or NED east component."]
15460 pub baseline_b_mm: i32,
15461 #[doc = "Current baseline in ECEF z or NED down component."]
15462 pub baseline_c_mm: i32,
15463 #[doc = "Current estimate of baseline accuracy."]
15464 pub accuracy: u32,
15465 #[doc = "Current number of integer ambiguity hypotheses."]
15466 pub iar_num_hypotheses: i32,
15467 #[doc = "GPS Week Number of last baseline"]
15468 pub wn: u16,
15469 #[doc = "Identification of connected RTK receiver."]
15470 pub rtk_receiver_id: u8,
15471 #[doc = "GPS-specific health report for RTK data."]
15472 pub rtk_health: u8,
15473 #[doc = "Rate of baseline messages being received by GPS"]
15474 pub rtk_rate: u8,
15475 #[doc = "Current number of sats used for RTK calculation."]
15476 pub nsats: u8,
15477 #[doc = "Coordinate system of baseline"]
15478 pub baseline_coords_type: RtkBaselineCoordinateSystem,
15479}
15480impl GPS_RTK_DATA {
15481 pub const ENCODED_LEN: usize = 35usize;
15482 pub const DEFAULT: Self = Self {
15483 time_last_baseline_ms: 0_u32,
15484 tow: 0_u32,
15485 baseline_a_mm: 0_i32,
15486 baseline_b_mm: 0_i32,
15487 baseline_c_mm: 0_i32,
15488 accuracy: 0_u32,
15489 iar_num_hypotheses: 0_i32,
15490 wn: 0_u16,
15491 rtk_receiver_id: 0_u8,
15492 rtk_health: 0_u8,
15493 rtk_rate: 0_u8,
15494 nsats: 0_u8,
15495 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
15496 };
15497 #[cfg(feature = "arbitrary")]
15498 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15499 use arbitrary::{Arbitrary, Unstructured};
15500 let mut buf = [0u8; 1024];
15501 rng.fill_bytes(&mut buf);
15502 let mut unstructured = Unstructured::new(&buf);
15503 Self::arbitrary(&mut unstructured).unwrap_or_default()
15504 }
15505}
15506impl Default for GPS_RTK_DATA {
15507 fn default() -> Self {
15508 Self::DEFAULT.clone()
15509 }
15510}
15511impl MessageData for GPS_RTK_DATA {
15512 type Message = MavMessage;
15513 const ID: u32 = 127u32;
15514 const NAME: &'static str = "GPS_RTK";
15515 const EXTRA_CRC: u8 = 25u8;
15516 const ENCODED_LEN: usize = 35usize;
15517 fn deser(
15518 _version: MavlinkVersion,
15519 __input: &[u8],
15520 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15521 let avail_len = __input.len();
15522 let mut payload_buf = [0; Self::ENCODED_LEN];
15523 let mut buf = if avail_len < Self::ENCODED_LEN {
15524 payload_buf[0..avail_len].copy_from_slice(__input);
15525 Bytes::new(&payload_buf)
15526 } else {
15527 Bytes::new(__input)
15528 };
15529 let mut __struct = Self::default();
15530 __struct.time_last_baseline_ms = buf.get_u32_le()?;
15531 __struct.tow = buf.get_u32_le()?;
15532 __struct.baseline_a_mm = buf.get_i32_le()?;
15533 __struct.baseline_b_mm = buf.get_i32_le()?;
15534 __struct.baseline_c_mm = buf.get_i32_le()?;
15535 __struct.accuracy = buf.get_u32_le()?;
15536 __struct.iar_num_hypotheses = buf.get_i32_le()?;
15537 __struct.wn = buf.get_u16_le()?;
15538 __struct.rtk_receiver_id = buf.get_u8()?;
15539 __struct.rtk_health = buf.get_u8()?;
15540 __struct.rtk_rate = buf.get_u8()?;
15541 __struct.nsats = buf.get_u8()?;
15542 let tmp = buf.get_u8()?;
15543 __struct.baseline_coords_type =
15544 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15545 enum_type: "RtkBaselineCoordinateSystem",
15546 value: tmp as u64,
15547 })?;
15548 Ok(__struct)
15549 }
15550 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15551 let mut __tmp = BytesMut::new(bytes);
15552 #[allow(clippy::absurd_extreme_comparisons)]
15553 #[allow(unused_comparisons)]
15554 if __tmp.remaining() < Self::ENCODED_LEN {
15555 panic!(
15556 "buffer is too small (need {} bytes, but got {})",
15557 Self::ENCODED_LEN,
15558 __tmp.remaining(),
15559 )
15560 }
15561 __tmp.put_u32_le(self.time_last_baseline_ms);
15562 __tmp.put_u32_le(self.tow);
15563 __tmp.put_i32_le(self.baseline_a_mm);
15564 __tmp.put_i32_le(self.baseline_b_mm);
15565 __tmp.put_i32_le(self.baseline_c_mm);
15566 __tmp.put_u32_le(self.accuracy);
15567 __tmp.put_i32_le(self.iar_num_hypotheses);
15568 __tmp.put_u16_le(self.wn);
15569 __tmp.put_u8(self.rtk_receiver_id);
15570 __tmp.put_u8(self.rtk_health);
15571 __tmp.put_u8(self.rtk_rate);
15572 __tmp.put_u8(self.nsats);
15573 __tmp.put_u8(self.baseline_coords_type as u8);
15574 if matches!(version, MavlinkVersion::V2) {
15575 let len = __tmp.len();
15576 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15577 } else {
15578 __tmp.len()
15579 }
15580 }
15581}
15582#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
15583#[doc = ""]
15584#[doc = "ID: 25"]
15585#[derive(Debug, Clone, PartialEq)]
15586#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15587#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15588#[cfg_attr(feature = "ts", derive(TS))]
15589#[cfg_attr(feature = "ts", ts(export))]
15590pub struct GPS_STATUS_DATA {
15591 #[doc = "Number of satellites visible"]
15592 pub satellites_visible: u8,
15593 #[doc = "Global satellite ID"]
15594 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15595 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15596 pub satellite_prn: [u8; 20],
15597 #[doc = "0: Satellite not used, 1: used for localization"]
15598 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15599 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15600 pub satellite_used: [u8; 20],
15601 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
15602 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15603 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15604 pub satellite_elevation: [u8; 20],
15605 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
15606 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15607 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15608 pub satellite_azimuth: [u8; 20],
15609 #[doc = "Signal to noise ratio of satellite"]
15610 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15611 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
15612 pub satellite_snr: [u8; 20],
15613}
15614impl GPS_STATUS_DATA {
15615 pub const ENCODED_LEN: usize = 101usize;
15616 pub const DEFAULT: Self = Self {
15617 satellites_visible: 0_u8,
15618 satellite_prn: [0_u8; 20usize],
15619 satellite_used: [0_u8; 20usize],
15620 satellite_elevation: [0_u8; 20usize],
15621 satellite_azimuth: [0_u8; 20usize],
15622 satellite_snr: [0_u8; 20usize],
15623 };
15624 #[cfg(feature = "arbitrary")]
15625 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15626 use arbitrary::{Arbitrary, Unstructured};
15627 let mut buf = [0u8; 1024];
15628 rng.fill_bytes(&mut buf);
15629 let mut unstructured = Unstructured::new(&buf);
15630 Self::arbitrary(&mut unstructured).unwrap_or_default()
15631 }
15632}
15633impl Default for GPS_STATUS_DATA {
15634 fn default() -> Self {
15635 Self::DEFAULT.clone()
15636 }
15637}
15638impl MessageData for GPS_STATUS_DATA {
15639 type Message = MavMessage;
15640 const ID: u32 = 25u32;
15641 const NAME: &'static str = "GPS_STATUS";
15642 const EXTRA_CRC: u8 = 23u8;
15643 const ENCODED_LEN: usize = 101usize;
15644 fn deser(
15645 _version: MavlinkVersion,
15646 __input: &[u8],
15647 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15648 let avail_len = __input.len();
15649 let mut payload_buf = [0; Self::ENCODED_LEN];
15650 let mut buf = if avail_len < Self::ENCODED_LEN {
15651 payload_buf[0..avail_len].copy_from_slice(__input);
15652 Bytes::new(&payload_buf)
15653 } else {
15654 Bytes::new(__input)
15655 };
15656 let mut __struct = Self::default();
15657 __struct.satellites_visible = buf.get_u8()?;
15658 for v in &mut __struct.satellite_prn {
15659 let val = buf.get_u8()?;
15660 *v = val;
15661 }
15662 for v in &mut __struct.satellite_used {
15663 let val = buf.get_u8()?;
15664 *v = val;
15665 }
15666 for v in &mut __struct.satellite_elevation {
15667 let val = buf.get_u8()?;
15668 *v = val;
15669 }
15670 for v in &mut __struct.satellite_azimuth {
15671 let val = buf.get_u8()?;
15672 *v = val;
15673 }
15674 for v in &mut __struct.satellite_snr {
15675 let val = buf.get_u8()?;
15676 *v = val;
15677 }
15678 Ok(__struct)
15679 }
15680 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15681 let mut __tmp = BytesMut::new(bytes);
15682 #[allow(clippy::absurd_extreme_comparisons)]
15683 #[allow(unused_comparisons)]
15684 if __tmp.remaining() < Self::ENCODED_LEN {
15685 panic!(
15686 "buffer is too small (need {} bytes, but got {})",
15687 Self::ENCODED_LEN,
15688 __tmp.remaining(),
15689 )
15690 }
15691 __tmp.put_u8(self.satellites_visible);
15692 for val in &self.satellite_prn {
15693 __tmp.put_u8(*val);
15694 }
15695 for val in &self.satellite_used {
15696 __tmp.put_u8(*val);
15697 }
15698 for val in &self.satellite_elevation {
15699 __tmp.put_u8(*val);
15700 }
15701 for val in &self.satellite_azimuth {
15702 __tmp.put_u8(*val);
15703 }
15704 for val in &self.satellite_snr {
15705 __tmp.put_u8(*val);
15706 }
15707 if matches!(version, MavlinkVersion::V2) {
15708 let len = __tmp.len();
15709 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15710 } else {
15711 __tmp.len()
15712 }
15713 }
15714}
15715#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
15716#[doc = ""]
15717#[doc = "ID: 0"]
15718#[derive(Debug, Clone, PartialEq)]
15719#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15720#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15721#[cfg_attr(feature = "ts", derive(TS))]
15722#[cfg_attr(feature = "ts", ts(export))]
15723pub struct HEARTBEAT_DATA {
15724 #[doc = "A bitfield for use for autopilot-specific flags"]
15725 pub custom_mode: u32,
15726 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
15727 pub mavtype: MavType,
15728 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15729 pub autopilot: MavAutopilot,
15730 #[doc = "System mode bitmap."]
15731 pub base_mode: MavModeFlag,
15732 #[doc = "System status flag."]
15733 pub system_status: MavState,
15734 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
15735 pub mavlink_version: u8,
15736}
15737impl HEARTBEAT_DATA {
15738 pub const ENCODED_LEN: usize = 9usize;
15739 pub const DEFAULT: Self = Self {
15740 custom_mode: 0_u32,
15741 mavtype: MavType::DEFAULT,
15742 autopilot: MavAutopilot::DEFAULT,
15743 base_mode: MavModeFlag::DEFAULT,
15744 system_status: MavState::DEFAULT,
15745 mavlink_version: MINOR_MAVLINK_VERSION,
15746 };
15747 #[cfg(feature = "arbitrary")]
15748 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15749 use arbitrary::{Arbitrary, Unstructured};
15750 let mut buf = [0u8; 1024];
15751 rng.fill_bytes(&mut buf);
15752 let mut unstructured = Unstructured::new(&buf);
15753 Self::arbitrary(&mut unstructured).unwrap_or_default()
15754 }
15755}
15756impl Default for HEARTBEAT_DATA {
15757 fn default() -> Self {
15758 Self::DEFAULT.clone()
15759 }
15760}
15761impl MessageData for HEARTBEAT_DATA {
15762 type Message = MavMessage;
15763 const ID: u32 = 0u32;
15764 const NAME: &'static str = "HEARTBEAT";
15765 const EXTRA_CRC: u8 = 50u8;
15766 const ENCODED_LEN: usize = 9usize;
15767 fn deser(
15768 _version: MavlinkVersion,
15769 __input: &[u8],
15770 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15771 let avail_len = __input.len();
15772 let mut payload_buf = [0; Self::ENCODED_LEN];
15773 let mut buf = if avail_len < Self::ENCODED_LEN {
15774 payload_buf[0..avail_len].copy_from_slice(__input);
15775 Bytes::new(&payload_buf)
15776 } else {
15777 Bytes::new(__input)
15778 };
15779 let mut __struct = Self::default();
15780 __struct.custom_mode = buf.get_u32_le()?;
15781 let tmp = buf.get_u8()?;
15782 __struct.mavtype =
15783 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15784 enum_type: "MavType",
15785 value: tmp as u64,
15786 })?;
15787 let tmp = buf.get_u8()?;
15788 __struct.autopilot =
15789 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15790 enum_type: "MavAutopilot",
15791 value: tmp as u64,
15792 })?;
15793 let tmp = buf.get_u8()?;
15794 __struct.base_mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
15795 ::mavlink_core::error::ParserError::InvalidFlag {
15796 flag_type: "MavModeFlag",
15797 value: tmp as u64,
15798 },
15799 )?;
15800 let tmp = buf.get_u8()?;
15801 __struct.system_status =
15802 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15803 enum_type: "MavState",
15804 value: tmp as u64,
15805 })?;
15806 __struct.mavlink_version = buf.get_u8()?;
15807 Ok(__struct)
15808 }
15809 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15810 let mut __tmp = BytesMut::new(bytes);
15811 #[allow(clippy::absurd_extreme_comparisons)]
15812 #[allow(unused_comparisons)]
15813 if __tmp.remaining() < Self::ENCODED_LEN {
15814 panic!(
15815 "buffer is too small (need {} bytes, but got {})",
15816 Self::ENCODED_LEN,
15817 __tmp.remaining(),
15818 )
15819 }
15820 __tmp.put_u32_le(self.custom_mode);
15821 __tmp.put_u8(self.mavtype as u8);
15822 __tmp.put_u8(self.autopilot as u8);
15823 __tmp.put_u8(self.base_mode.bits() as u8);
15824 __tmp.put_u8(self.system_status as u8);
15825 __tmp.put_u8(self.mavlink_version);
15826 if matches!(version, MavlinkVersion::V2) {
15827 let len = __tmp.len();
15828 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15829 } else {
15830 __tmp.len()
15831 }
15832 }
15833}
15834#[doc = "The IMU readings in SI units in NED body frame."]
15835#[doc = ""]
15836#[doc = "ID: 105"]
15837#[derive(Debug, Clone, PartialEq)]
15838#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15839#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15840#[cfg_attr(feature = "ts", derive(TS))]
15841#[cfg_attr(feature = "ts", ts(export))]
15842pub struct HIGHRES_IMU_DATA {
15843 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15844 pub time_usec: u64,
15845 #[doc = "X acceleration"]
15846 pub xacc: f32,
15847 #[doc = "Y acceleration"]
15848 pub yacc: f32,
15849 #[doc = "Z acceleration"]
15850 pub zacc: f32,
15851 #[doc = "Angular speed around X axis"]
15852 pub xgyro: f32,
15853 #[doc = "Angular speed around Y axis"]
15854 pub ygyro: f32,
15855 #[doc = "Angular speed around Z axis"]
15856 pub zgyro: f32,
15857 #[doc = "X Magnetic field"]
15858 pub xmag: f32,
15859 #[doc = "Y Magnetic field"]
15860 pub ymag: f32,
15861 #[doc = "Z Magnetic field"]
15862 pub zmag: f32,
15863 #[doc = "Absolute pressure"]
15864 pub abs_pressure: f32,
15865 #[doc = "Differential pressure"]
15866 pub diff_pressure: f32,
15867 #[doc = "Altitude calculated from pressure"]
15868 pub pressure_alt: f32,
15869 #[doc = "Temperature"]
15870 pub temperature: f32,
15871 #[doc = "Bitmap for fields that have updated since last message"]
15872 pub fields_updated: HighresImuUpdatedFlags,
15873 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
15874 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15875 pub id: u8,
15876}
15877impl HIGHRES_IMU_DATA {
15878 pub const ENCODED_LEN: usize = 63usize;
15879 pub const DEFAULT: Self = Self {
15880 time_usec: 0_u64,
15881 xacc: 0.0_f32,
15882 yacc: 0.0_f32,
15883 zacc: 0.0_f32,
15884 xgyro: 0.0_f32,
15885 ygyro: 0.0_f32,
15886 zgyro: 0.0_f32,
15887 xmag: 0.0_f32,
15888 ymag: 0.0_f32,
15889 zmag: 0.0_f32,
15890 abs_pressure: 0.0_f32,
15891 diff_pressure: 0.0_f32,
15892 pressure_alt: 0.0_f32,
15893 temperature: 0.0_f32,
15894 fields_updated: HighresImuUpdatedFlags::DEFAULT,
15895 id: 0_u8,
15896 };
15897 #[cfg(feature = "arbitrary")]
15898 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15899 use arbitrary::{Arbitrary, Unstructured};
15900 let mut buf = [0u8; 1024];
15901 rng.fill_bytes(&mut buf);
15902 let mut unstructured = Unstructured::new(&buf);
15903 Self::arbitrary(&mut unstructured).unwrap_or_default()
15904 }
15905}
15906impl Default for HIGHRES_IMU_DATA {
15907 fn default() -> Self {
15908 Self::DEFAULT.clone()
15909 }
15910}
15911impl MessageData for HIGHRES_IMU_DATA {
15912 type Message = MavMessage;
15913 const ID: u32 = 105u32;
15914 const NAME: &'static str = "HIGHRES_IMU";
15915 const EXTRA_CRC: u8 = 93u8;
15916 const ENCODED_LEN: usize = 63usize;
15917 fn deser(
15918 _version: MavlinkVersion,
15919 __input: &[u8],
15920 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15921 let avail_len = __input.len();
15922 let mut payload_buf = [0; Self::ENCODED_LEN];
15923 let mut buf = if avail_len < Self::ENCODED_LEN {
15924 payload_buf[0..avail_len].copy_from_slice(__input);
15925 Bytes::new(&payload_buf)
15926 } else {
15927 Bytes::new(__input)
15928 };
15929 let mut __struct = Self::default();
15930 __struct.time_usec = buf.get_u64_le()?;
15931 __struct.xacc = buf.get_f32_le()?;
15932 __struct.yacc = buf.get_f32_le()?;
15933 __struct.zacc = buf.get_f32_le()?;
15934 __struct.xgyro = buf.get_f32_le()?;
15935 __struct.ygyro = buf.get_f32_le()?;
15936 __struct.zgyro = buf.get_f32_le()?;
15937 __struct.xmag = buf.get_f32_le()?;
15938 __struct.ymag = buf.get_f32_le()?;
15939 __struct.zmag = buf.get_f32_le()?;
15940 __struct.abs_pressure = buf.get_f32_le()?;
15941 __struct.diff_pressure = buf.get_f32_le()?;
15942 __struct.pressure_alt = buf.get_f32_le()?;
15943 __struct.temperature = buf.get_f32_le()?;
15944 let tmp = buf.get_u16_le()?;
15945 __struct.fields_updated =
15946 HighresImuUpdatedFlags::from_bits(tmp as <HighresImuUpdatedFlags as Flags>::Bits)
15947 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15948 flag_type: "HighresImuUpdatedFlags",
15949 value: tmp as u64,
15950 })?;
15951 __struct.id = buf.get_u8()?;
15952 Ok(__struct)
15953 }
15954 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15955 let mut __tmp = BytesMut::new(bytes);
15956 #[allow(clippy::absurd_extreme_comparisons)]
15957 #[allow(unused_comparisons)]
15958 if __tmp.remaining() < Self::ENCODED_LEN {
15959 panic!(
15960 "buffer is too small (need {} bytes, but got {})",
15961 Self::ENCODED_LEN,
15962 __tmp.remaining(),
15963 )
15964 }
15965 __tmp.put_u64_le(self.time_usec);
15966 __tmp.put_f32_le(self.xacc);
15967 __tmp.put_f32_le(self.yacc);
15968 __tmp.put_f32_le(self.zacc);
15969 __tmp.put_f32_le(self.xgyro);
15970 __tmp.put_f32_le(self.ygyro);
15971 __tmp.put_f32_le(self.zgyro);
15972 __tmp.put_f32_le(self.xmag);
15973 __tmp.put_f32_le(self.ymag);
15974 __tmp.put_f32_le(self.zmag);
15975 __tmp.put_f32_le(self.abs_pressure);
15976 __tmp.put_f32_le(self.diff_pressure);
15977 __tmp.put_f32_le(self.pressure_alt);
15978 __tmp.put_f32_le(self.temperature);
15979 __tmp.put_u16_le(self.fields_updated.bits() as u16);
15980 if matches!(version, MavlinkVersion::V2) {
15981 __tmp.put_u8(self.id);
15982 let len = __tmp.len();
15983 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15984 } else {
15985 __tmp.len()
15986 }
15987 }
15988}
15989#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
15990#[doc = "Message appropriate for high latency connections like Iridium."]
15991#[doc = ""]
15992#[doc = "ID: 234"]
15993#[derive(Debug, Clone, PartialEq)]
15994#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15995#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15996#[cfg_attr(feature = "ts", derive(TS))]
15997#[cfg_attr(feature = "ts", ts(export))]
15998pub struct HIGH_LATENCY_DATA {
15999 #[doc = "A bitfield for use for autopilot-specific flags."]
16000 pub custom_mode: u32,
16001 #[doc = "Latitude"]
16002 pub latitude: i32,
16003 #[doc = "Longitude"]
16004 pub longitude: i32,
16005 #[doc = "roll"]
16006 pub roll: i16,
16007 #[doc = "pitch"]
16008 pub pitch: i16,
16009 #[doc = "heading"]
16010 pub heading: u16,
16011 #[doc = "heading setpoint"]
16012 pub heading_sp: i16,
16013 #[doc = "Altitude above mean sea level"]
16014 pub altitude_amsl: i16,
16015 #[doc = "Altitude setpoint relative to the home position"]
16016 pub altitude_sp: i16,
16017 #[doc = "distance to target"]
16018 pub wp_distance: u16,
16019 #[doc = "Bitmap of enabled system modes."]
16020 pub base_mode: MavModeFlag,
16021 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
16022 pub landed_state: MavLandedState,
16023 #[doc = "throttle (percentage)"]
16024 pub throttle: i8,
16025 #[doc = "airspeed"]
16026 pub airspeed: u8,
16027 #[doc = "airspeed setpoint"]
16028 pub airspeed_sp: u8,
16029 #[doc = "groundspeed"]
16030 pub groundspeed: u8,
16031 #[doc = "climb rate"]
16032 pub climb_rate: i8,
16033 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
16034 pub gps_nsat: u8,
16035 #[doc = "GPS Fix type."]
16036 pub gps_fix_type: GpsFixType,
16037 #[doc = "Remaining battery (percentage)"]
16038 pub battery_remaining: u8,
16039 #[doc = "Autopilot temperature (degrees C)"]
16040 pub temperature: i8,
16041 #[doc = "Air temperature (degrees C) from airspeed sensor"]
16042 pub temperature_air: i8,
16043 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
16044 pub failsafe: u8,
16045 #[doc = "current waypoint number"]
16046 pub wp_num: u8,
16047}
16048impl HIGH_LATENCY_DATA {
16049 pub const ENCODED_LEN: usize = 40usize;
16050 pub const DEFAULT: Self = Self {
16051 custom_mode: 0_u32,
16052 latitude: 0_i32,
16053 longitude: 0_i32,
16054 roll: 0_i16,
16055 pitch: 0_i16,
16056 heading: 0_u16,
16057 heading_sp: 0_i16,
16058 altitude_amsl: 0_i16,
16059 altitude_sp: 0_i16,
16060 wp_distance: 0_u16,
16061 base_mode: MavModeFlag::DEFAULT,
16062 landed_state: MavLandedState::DEFAULT,
16063 throttle: 0_i8,
16064 airspeed: 0_u8,
16065 airspeed_sp: 0_u8,
16066 groundspeed: 0_u8,
16067 climb_rate: 0_i8,
16068 gps_nsat: 0_u8,
16069 gps_fix_type: GpsFixType::DEFAULT,
16070 battery_remaining: 0_u8,
16071 temperature: 0_i8,
16072 temperature_air: 0_i8,
16073 failsafe: 0_u8,
16074 wp_num: 0_u8,
16075 };
16076 #[cfg(feature = "arbitrary")]
16077 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16078 use arbitrary::{Arbitrary, Unstructured};
16079 let mut buf = [0u8; 1024];
16080 rng.fill_bytes(&mut buf);
16081 let mut unstructured = Unstructured::new(&buf);
16082 Self::arbitrary(&mut unstructured).unwrap_or_default()
16083 }
16084}
16085impl Default for HIGH_LATENCY_DATA {
16086 fn default() -> Self {
16087 Self::DEFAULT.clone()
16088 }
16089}
16090impl MessageData for HIGH_LATENCY_DATA {
16091 type Message = MavMessage;
16092 const ID: u32 = 234u32;
16093 const NAME: &'static str = "HIGH_LATENCY";
16094 const EXTRA_CRC: u8 = 150u8;
16095 const ENCODED_LEN: usize = 40usize;
16096 fn deser(
16097 _version: MavlinkVersion,
16098 __input: &[u8],
16099 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16100 let avail_len = __input.len();
16101 let mut payload_buf = [0; Self::ENCODED_LEN];
16102 let mut buf = if avail_len < Self::ENCODED_LEN {
16103 payload_buf[0..avail_len].copy_from_slice(__input);
16104 Bytes::new(&payload_buf)
16105 } else {
16106 Bytes::new(__input)
16107 };
16108 let mut __struct = Self::default();
16109 __struct.custom_mode = buf.get_u32_le()?;
16110 __struct.latitude = buf.get_i32_le()?;
16111 __struct.longitude = buf.get_i32_le()?;
16112 __struct.roll = buf.get_i16_le()?;
16113 __struct.pitch = buf.get_i16_le()?;
16114 __struct.heading = buf.get_u16_le()?;
16115 __struct.heading_sp = buf.get_i16_le()?;
16116 __struct.altitude_amsl = buf.get_i16_le()?;
16117 __struct.altitude_sp = buf.get_i16_le()?;
16118 __struct.wp_distance = buf.get_u16_le()?;
16119 let tmp = buf.get_u8()?;
16120 __struct.base_mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
16121 ::mavlink_core::error::ParserError::InvalidFlag {
16122 flag_type: "MavModeFlag",
16123 value: tmp as u64,
16124 },
16125 )?;
16126 let tmp = buf.get_u8()?;
16127 __struct.landed_state =
16128 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16129 enum_type: "MavLandedState",
16130 value: tmp as u64,
16131 })?;
16132 __struct.throttle = buf.get_i8()?;
16133 __struct.airspeed = buf.get_u8()?;
16134 __struct.airspeed_sp = buf.get_u8()?;
16135 __struct.groundspeed = buf.get_u8()?;
16136 __struct.climb_rate = buf.get_i8()?;
16137 __struct.gps_nsat = buf.get_u8()?;
16138 let tmp = buf.get_u8()?;
16139 __struct.gps_fix_type =
16140 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16141 enum_type: "GpsFixType",
16142 value: tmp as u64,
16143 })?;
16144 __struct.battery_remaining = buf.get_u8()?;
16145 __struct.temperature = buf.get_i8()?;
16146 __struct.temperature_air = buf.get_i8()?;
16147 __struct.failsafe = buf.get_u8()?;
16148 __struct.wp_num = buf.get_u8()?;
16149 Ok(__struct)
16150 }
16151 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16152 let mut __tmp = BytesMut::new(bytes);
16153 #[allow(clippy::absurd_extreme_comparisons)]
16154 #[allow(unused_comparisons)]
16155 if __tmp.remaining() < Self::ENCODED_LEN {
16156 panic!(
16157 "buffer is too small (need {} bytes, but got {})",
16158 Self::ENCODED_LEN,
16159 __tmp.remaining(),
16160 )
16161 }
16162 __tmp.put_u32_le(self.custom_mode);
16163 __tmp.put_i32_le(self.latitude);
16164 __tmp.put_i32_le(self.longitude);
16165 __tmp.put_i16_le(self.roll);
16166 __tmp.put_i16_le(self.pitch);
16167 __tmp.put_u16_le(self.heading);
16168 __tmp.put_i16_le(self.heading_sp);
16169 __tmp.put_i16_le(self.altitude_amsl);
16170 __tmp.put_i16_le(self.altitude_sp);
16171 __tmp.put_u16_le(self.wp_distance);
16172 __tmp.put_u8(self.base_mode.bits() as u8);
16173 __tmp.put_u8(self.landed_state as u8);
16174 __tmp.put_i8(self.throttle);
16175 __tmp.put_u8(self.airspeed);
16176 __tmp.put_u8(self.airspeed_sp);
16177 __tmp.put_u8(self.groundspeed);
16178 __tmp.put_i8(self.climb_rate);
16179 __tmp.put_u8(self.gps_nsat);
16180 __tmp.put_u8(self.gps_fix_type as u8);
16181 __tmp.put_u8(self.battery_remaining);
16182 __tmp.put_i8(self.temperature);
16183 __tmp.put_i8(self.temperature_air);
16184 __tmp.put_u8(self.failsafe);
16185 __tmp.put_u8(self.wp_num);
16186 if matches!(version, MavlinkVersion::V2) {
16187 let len = __tmp.len();
16188 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16189 } else {
16190 __tmp.len()
16191 }
16192 }
16193}
16194#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
16195#[doc = ""]
16196#[doc = "ID: 235"]
16197#[derive(Debug, Clone, PartialEq)]
16198#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16199#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16200#[cfg_attr(feature = "ts", derive(TS))]
16201#[cfg_attr(feature = "ts", ts(export))]
16202pub struct HIGH_LATENCY2_DATA {
16203 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
16204 pub timestamp: u32,
16205 #[doc = "Latitude"]
16206 pub latitude: i32,
16207 #[doc = "Longitude"]
16208 pub longitude: i32,
16209 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
16210 pub custom_mode: u16,
16211 #[doc = "Altitude above mean sea level"]
16212 pub altitude: i16,
16213 #[doc = "Altitude setpoint"]
16214 pub target_altitude: i16,
16215 #[doc = "Distance to target waypoint or position"]
16216 pub target_distance: u16,
16217 #[doc = "Current waypoint number"]
16218 pub wp_num: u16,
16219 #[doc = "Bitmap of failure flags."]
16220 pub failure_flags: HlFailureFlag,
16221 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
16222 pub mavtype: MavType,
16223 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
16224 pub autopilot: MavAutopilot,
16225 #[doc = "Heading"]
16226 pub heading: u8,
16227 #[doc = "Heading setpoint"]
16228 pub target_heading: u8,
16229 #[doc = "Throttle"]
16230 pub throttle: u8,
16231 #[doc = "Airspeed"]
16232 pub airspeed: u8,
16233 #[doc = "Airspeed setpoint"]
16234 pub airspeed_sp: u8,
16235 #[doc = "Groundspeed"]
16236 pub groundspeed: u8,
16237 #[doc = "Windspeed"]
16238 pub windspeed: u8,
16239 #[doc = "Wind heading"]
16240 pub wind_heading: u8,
16241 #[doc = "Maximum error horizontal position since last message"]
16242 pub eph: u8,
16243 #[doc = "Maximum error vertical position since last message"]
16244 pub epv: u8,
16245 #[doc = "Air temperature"]
16246 pub temperature_air: i8,
16247 #[doc = "Maximum climb rate magnitude since last message"]
16248 pub climb_rate: i8,
16249 #[doc = "Battery level (-1 if field not provided)."]
16250 pub battery: i8,
16251 #[doc = "Field for custom payload."]
16252 pub custom0: i8,
16253 #[doc = "Field for custom payload."]
16254 pub custom1: i8,
16255 #[doc = "Field for custom payload."]
16256 pub custom2: i8,
16257}
16258impl HIGH_LATENCY2_DATA {
16259 pub const ENCODED_LEN: usize = 42usize;
16260 pub const DEFAULT: Self = Self {
16261 timestamp: 0_u32,
16262 latitude: 0_i32,
16263 longitude: 0_i32,
16264 custom_mode: 0_u16,
16265 altitude: 0_i16,
16266 target_altitude: 0_i16,
16267 target_distance: 0_u16,
16268 wp_num: 0_u16,
16269 failure_flags: HlFailureFlag::DEFAULT,
16270 mavtype: MavType::DEFAULT,
16271 autopilot: MavAutopilot::DEFAULT,
16272 heading: 0_u8,
16273 target_heading: 0_u8,
16274 throttle: 0_u8,
16275 airspeed: 0_u8,
16276 airspeed_sp: 0_u8,
16277 groundspeed: 0_u8,
16278 windspeed: 0_u8,
16279 wind_heading: 0_u8,
16280 eph: 0_u8,
16281 epv: 0_u8,
16282 temperature_air: 0_i8,
16283 climb_rate: 0_i8,
16284 battery: 0_i8,
16285 custom0: 0_i8,
16286 custom1: 0_i8,
16287 custom2: 0_i8,
16288 };
16289 #[cfg(feature = "arbitrary")]
16290 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16291 use arbitrary::{Arbitrary, Unstructured};
16292 let mut buf = [0u8; 1024];
16293 rng.fill_bytes(&mut buf);
16294 let mut unstructured = Unstructured::new(&buf);
16295 Self::arbitrary(&mut unstructured).unwrap_or_default()
16296 }
16297}
16298impl Default for HIGH_LATENCY2_DATA {
16299 fn default() -> Self {
16300 Self::DEFAULT.clone()
16301 }
16302}
16303impl MessageData for HIGH_LATENCY2_DATA {
16304 type Message = MavMessage;
16305 const ID: u32 = 235u32;
16306 const NAME: &'static str = "HIGH_LATENCY2";
16307 const EXTRA_CRC: u8 = 179u8;
16308 const ENCODED_LEN: usize = 42usize;
16309 fn deser(
16310 _version: MavlinkVersion,
16311 __input: &[u8],
16312 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16313 let avail_len = __input.len();
16314 let mut payload_buf = [0; Self::ENCODED_LEN];
16315 let mut buf = if avail_len < Self::ENCODED_LEN {
16316 payload_buf[0..avail_len].copy_from_slice(__input);
16317 Bytes::new(&payload_buf)
16318 } else {
16319 Bytes::new(__input)
16320 };
16321 let mut __struct = Self::default();
16322 __struct.timestamp = buf.get_u32_le()?;
16323 __struct.latitude = buf.get_i32_le()?;
16324 __struct.longitude = buf.get_i32_le()?;
16325 __struct.custom_mode = buf.get_u16_le()?;
16326 __struct.altitude = buf.get_i16_le()?;
16327 __struct.target_altitude = buf.get_i16_le()?;
16328 __struct.target_distance = buf.get_u16_le()?;
16329 __struct.wp_num = buf.get_u16_le()?;
16330 let tmp = buf.get_u16_le()?;
16331 __struct.failure_flags = HlFailureFlag::from_bits(tmp as <HlFailureFlag as Flags>::Bits)
16332 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16333 flag_type: "HlFailureFlag",
16334 value: tmp as u64,
16335 })?;
16336 let tmp = buf.get_u8()?;
16337 __struct.mavtype =
16338 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16339 enum_type: "MavType",
16340 value: tmp as u64,
16341 })?;
16342 let tmp = buf.get_u8()?;
16343 __struct.autopilot =
16344 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16345 enum_type: "MavAutopilot",
16346 value: tmp as u64,
16347 })?;
16348 __struct.heading = buf.get_u8()?;
16349 __struct.target_heading = buf.get_u8()?;
16350 __struct.throttle = buf.get_u8()?;
16351 __struct.airspeed = buf.get_u8()?;
16352 __struct.airspeed_sp = buf.get_u8()?;
16353 __struct.groundspeed = buf.get_u8()?;
16354 __struct.windspeed = buf.get_u8()?;
16355 __struct.wind_heading = buf.get_u8()?;
16356 __struct.eph = buf.get_u8()?;
16357 __struct.epv = buf.get_u8()?;
16358 __struct.temperature_air = buf.get_i8()?;
16359 __struct.climb_rate = buf.get_i8()?;
16360 __struct.battery = buf.get_i8()?;
16361 __struct.custom0 = buf.get_i8()?;
16362 __struct.custom1 = buf.get_i8()?;
16363 __struct.custom2 = buf.get_i8()?;
16364 Ok(__struct)
16365 }
16366 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16367 let mut __tmp = BytesMut::new(bytes);
16368 #[allow(clippy::absurd_extreme_comparisons)]
16369 #[allow(unused_comparisons)]
16370 if __tmp.remaining() < Self::ENCODED_LEN {
16371 panic!(
16372 "buffer is too small (need {} bytes, but got {})",
16373 Self::ENCODED_LEN,
16374 __tmp.remaining(),
16375 )
16376 }
16377 __tmp.put_u32_le(self.timestamp);
16378 __tmp.put_i32_le(self.latitude);
16379 __tmp.put_i32_le(self.longitude);
16380 __tmp.put_u16_le(self.custom_mode);
16381 __tmp.put_i16_le(self.altitude);
16382 __tmp.put_i16_le(self.target_altitude);
16383 __tmp.put_u16_le(self.target_distance);
16384 __tmp.put_u16_le(self.wp_num);
16385 __tmp.put_u16_le(self.failure_flags.bits() as u16);
16386 __tmp.put_u8(self.mavtype as u8);
16387 __tmp.put_u8(self.autopilot as u8);
16388 __tmp.put_u8(self.heading);
16389 __tmp.put_u8(self.target_heading);
16390 __tmp.put_u8(self.throttle);
16391 __tmp.put_u8(self.airspeed);
16392 __tmp.put_u8(self.airspeed_sp);
16393 __tmp.put_u8(self.groundspeed);
16394 __tmp.put_u8(self.windspeed);
16395 __tmp.put_u8(self.wind_heading);
16396 __tmp.put_u8(self.eph);
16397 __tmp.put_u8(self.epv);
16398 __tmp.put_i8(self.temperature_air);
16399 __tmp.put_i8(self.climb_rate);
16400 __tmp.put_i8(self.battery);
16401 __tmp.put_i8(self.custom0);
16402 __tmp.put_i8(self.custom1);
16403 __tmp.put_i8(self.custom2);
16404 if matches!(version, MavlinkVersion::V2) {
16405 let len = __tmp.len();
16406 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16407 } else {
16408 __tmp.len()
16409 }
16410 }
16411}
16412#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
16413#[doc = ""]
16414#[doc = "ID: 93"]
16415#[derive(Debug, Clone, PartialEq)]
16416#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16417#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16418#[cfg_attr(feature = "ts", derive(TS))]
16419#[cfg_attr(feature = "ts", ts(export))]
16420pub struct HIL_ACTUATOR_CONTROLS_DATA {
16421 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16422 pub time_usec: u64,
16423 #[doc = "Flags bitmask."]
16424 pub flags: HilActuatorControlsFlags,
16425 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
16426 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16427 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
16428 pub controls: [f32; 16],
16429 #[doc = "System mode. Includes arming state."]
16430 pub mode: MavModeFlag,
16431}
16432impl HIL_ACTUATOR_CONTROLS_DATA {
16433 pub const ENCODED_LEN: usize = 81usize;
16434 pub const DEFAULT: Self = Self {
16435 time_usec: 0_u64,
16436 flags: HilActuatorControlsFlags::DEFAULT,
16437 controls: [0.0_f32; 16usize],
16438 mode: MavModeFlag::DEFAULT,
16439 };
16440 #[cfg(feature = "arbitrary")]
16441 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16442 use arbitrary::{Arbitrary, Unstructured};
16443 let mut buf = [0u8; 1024];
16444 rng.fill_bytes(&mut buf);
16445 let mut unstructured = Unstructured::new(&buf);
16446 Self::arbitrary(&mut unstructured).unwrap_or_default()
16447 }
16448}
16449impl Default for HIL_ACTUATOR_CONTROLS_DATA {
16450 fn default() -> Self {
16451 Self::DEFAULT.clone()
16452 }
16453}
16454impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
16455 type Message = MavMessage;
16456 const ID: u32 = 93u32;
16457 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
16458 const EXTRA_CRC: u8 = 47u8;
16459 const ENCODED_LEN: usize = 81usize;
16460 fn deser(
16461 _version: MavlinkVersion,
16462 __input: &[u8],
16463 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16464 let avail_len = __input.len();
16465 let mut payload_buf = [0; Self::ENCODED_LEN];
16466 let mut buf = if avail_len < Self::ENCODED_LEN {
16467 payload_buf[0..avail_len].copy_from_slice(__input);
16468 Bytes::new(&payload_buf)
16469 } else {
16470 Bytes::new(__input)
16471 };
16472 let mut __struct = Self::default();
16473 __struct.time_usec = buf.get_u64_le()?;
16474 let tmp = buf.get_u64_le()?;
16475 __struct.flags =
16476 HilActuatorControlsFlags::from_bits(tmp as <HilActuatorControlsFlags as Flags>::Bits)
16477 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16478 flag_type: "HilActuatorControlsFlags",
16479 value: tmp as u64,
16480 })?;
16481 for v in &mut __struct.controls {
16482 let val = buf.get_f32_le()?;
16483 *v = val;
16484 }
16485 let tmp = buf.get_u8()?;
16486 __struct.mode = MavModeFlag::from_bits(tmp as <MavModeFlag as Flags>::Bits).ok_or(
16487 ::mavlink_core::error::ParserError::InvalidFlag {
16488 flag_type: "MavModeFlag",
16489 value: tmp as u64,
16490 },
16491 )?;
16492 Ok(__struct)
16493 }
16494 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16495 let mut __tmp = BytesMut::new(bytes);
16496 #[allow(clippy::absurd_extreme_comparisons)]
16497 #[allow(unused_comparisons)]
16498 if __tmp.remaining() < Self::ENCODED_LEN {
16499 panic!(
16500 "buffer is too small (need {} bytes, but got {})",
16501 Self::ENCODED_LEN,
16502 __tmp.remaining(),
16503 )
16504 }
16505 __tmp.put_u64_le(self.time_usec);
16506 __tmp.put_u64_le(self.flags.bits() as u64);
16507 for val in &self.controls {
16508 __tmp.put_f32_le(*val);
16509 }
16510 __tmp.put_u8(self.mode.bits() as u8);
16511 if matches!(version, MavlinkVersion::V2) {
16512 let len = __tmp.len();
16513 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16514 } else {
16515 __tmp.len()
16516 }
16517 }
16518}
16519#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
16520#[doc = ""]
16521#[doc = "ID: 91"]
16522#[derive(Debug, Clone, PartialEq)]
16523#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16524#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16525#[cfg_attr(feature = "ts", derive(TS))]
16526#[cfg_attr(feature = "ts", ts(export))]
16527pub struct HIL_CONTROLS_DATA {
16528 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16529 pub time_usec: u64,
16530 #[doc = "Control output -1 .. 1"]
16531 pub roll_ailerons: f32,
16532 #[doc = "Control output -1 .. 1"]
16533 pub pitch_elevator: f32,
16534 #[doc = "Control output -1 .. 1"]
16535 pub yaw_rudder: f32,
16536 #[doc = "Throttle 0 .. 1"]
16537 pub throttle: f32,
16538 #[doc = "Aux 1, -1 .. 1"]
16539 pub aux1: f32,
16540 #[doc = "Aux 2, -1 .. 1"]
16541 pub aux2: f32,
16542 #[doc = "Aux 3, -1 .. 1"]
16543 pub aux3: f32,
16544 #[doc = "Aux 4, -1 .. 1"]
16545 pub aux4: f32,
16546 #[doc = "System mode."]
16547 pub mode: MavMode,
16548 #[doc = "Navigation mode (MAV_NAV_MODE)"]
16549 pub nav_mode: u8,
16550}
16551impl HIL_CONTROLS_DATA {
16552 pub const ENCODED_LEN: usize = 42usize;
16553 pub const DEFAULT: Self = Self {
16554 time_usec: 0_u64,
16555 roll_ailerons: 0.0_f32,
16556 pitch_elevator: 0.0_f32,
16557 yaw_rudder: 0.0_f32,
16558 throttle: 0.0_f32,
16559 aux1: 0.0_f32,
16560 aux2: 0.0_f32,
16561 aux3: 0.0_f32,
16562 aux4: 0.0_f32,
16563 mode: MavMode::DEFAULT,
16564 nav_mode: 0_u8,
16565 };
16566 #[cfg(feature = "arbitrary")]
16567 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16568 use arbitrary::{Arbitrary, Unstructured};
16569 let mut buf = [0u8; 1024];
16570 rng.fill_bytes(&mut buf);
16571 let mut unstructured = Unstructured::new(&buf);
16572 Self::arbitrary(&mut unstructured).unwrap_or_default()
16573 }
16574}
16575impl Default for HIL_CONTROLS_DATA {
16576 fn default() -> Self {
16577 Self::DEFAULT.clone()
16578 }
16579}
16580impl MessageData for HIL_CONTROLS_DATA {
16581 type Message = MavMessage;
16582 const ID: u32 = 91u32;
16583 const NAME: &'static str = "HIL_CONTROLS";
16584 const EXTRA_CRC: u8 = 63u8;
16585 const ENCODED_LEN: usize = 42usize;
16586 fn deser(
16587 _version: MavlinkVersion,
16588 __input: &[u8],
16589 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16590 let avail_len = __input.len();
16591 let mut payload_buf = [0; Self::ENCODED_LEN];
16592 let mut buf = if avail_len < Self::ENCODED_LEN {
16593 payload_buf[0..avail_len].copy_from_slice(__input);
16594 Bytes::new(&payload_buf)
16595 } else {
16596 Bytes::new(__input)
16597 };
16598 let mut __struct = Self::default();
16599 __struct.time_usec = buf.get_u64_le()?;
16600 __struct.roll_ailerons = buf.get_f32_le()?;
16601 __struct.pitch_elevator = buf.get_f32_le()?;
16602 __struct.yaw_rudder = buf.get_f32_le()?;
16603 __struct.throttle = buf.get_f32_le()?;
16604 __struct.aux1 = buf.get_f32_le()?;
16605 __struct.aux2 = buf.get_f32_le()?;
16606 __struct.aux3 = buf.get_f32_le()?;
16607 __struct.aux4 = buf.get_f32_le()?;
16608 let tmp = buf.get_u8()?;
16609 __struct.mode =
16610 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16611 enum_type: "MavMode",
16612 value: tmp as u64,
16613 })?;
16614 __struct.nav_mode = buf.get_u8()?;
16615 Ok(__struct)
16616 }
16617 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16618 let mut __tmp = BytesMut::new(bytes);
16619 #[allow(clippy::absurd_extreme_comparisons)]
16620 #[allow(unused_comparisons)]
16621 if __tmp.remaining() < Self::ENCODED_LEN {
16622 panic!(
16623 "buffer is too small (need {} bytes, but got {})",
16624 Self::ENCODED_LEN,
16625 __tmp.remaining(),
16626 )
16627 }
16628 __tmp.put_u64_le(self.time_usec);
16629 __tmp.put_f32_le(self.roll_ailerons);
16630 __tmp.put_f32_le(self.pitch_elevator);
16631 __tmp.put_f32_le(self.yaw_rudder);
16632 __tmp.put_f32_le(self.throttle);
16633 __tmp.put_f32_le(self.aux1);
16634 __tmp.put_f32_le(self.aux2);
16635 __tmp.put_f32_le(self.aux3);
16636 __tmp.put_f32_le(self.aux4);
16637 __tmp.put_u8(self.mode as u8);
16638 __tmp.put_u8(self.nav_mode);
16639 if matches!(version, MavlinkVersion::V2) {
16640 let len = __tmp.len();
16641 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16642 } else {
16643 __tmp.len()
16644 }
16645 }
16646}
16647#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
16648#[doc = ""]
16649#[doc = "ID: 113"]
16650#[derive(Debug, Clone, PartialEq)]
16651#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16652#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16653#[cfg_attr(feature = "ts", derive(TS))]
16654#[cfg_attr(feature = "ts", ts(export))]
16655pub struct HIL_GPS_DATA {
16656 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16657 pub time_usec: u64,
16658 #[doc = "Latitude (WGS84)"]
16659 pub lat: i32,
16660 #[doc = "Longitude (WGS84)"]
16661 pub lon: i32,
16662 #[doc = "Altitude (MSL). Positive for up."]
16663 pub alt: i32,
16664 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16665 pub eph: u16,
16666 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
16667 pub epv: u16,
16668 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
16669 pub vel: u16,
16670 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
16671 pub vn: i16,
16672 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
16673 pub ve: i16,
16674 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
16675 pub vd: i16,
16676 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
16677 pub cog: u16,
16678 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
16679 pub fix_type: u8,
16680 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
16681 pub satellites_visible: u8,
16682 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
16683 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16684 pub id: u8,
16685 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
16686 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16687 pub yaw: u16,
16688}
16689impl HIL_GPS_DATA {
16690 pub const ENCODED_LEN: usize = 39usize;
16691 pub const DEFAULT: Self = Self {
16692 time_usec: 0_u64,
16693 lat: 0_i32,
16694 lon: 0_i32,
16695 alt: 0_i32,
16696 eph: 0_u16,
16697 epv: 0_u16,
16698 vel: 0_u16,
16699 vn: 0_i16,
16700 ve: 0_i16,
16701 vd: 0_i16,
16702 cog: 0_u16,
16703 fix_type: 0_u8,
16704 satellites_visible: 0_u8,
16705 id: 0_u8,
16706 yaw: 0_u16,
16707 };
16708 #[cfg(feature = "arbitrary")]
16709 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16710 use arbitrary::{Arbitrary, Unstructured};
16711 let mut buf = [0u8; 1024];
16712 rng.fill_bytes(&mut buf);
16713 let mut unstructured = Unstructured::new(&buf);
16714 Self::arbitrary(&mut unstructured).unwrap_or_default()
16715 }
16716}
16717impl Default for HIL_GPS_DATA {
16718 fn default() -> Self {
16719 Self::DEFAULT.clone()
16720 }
16721}
16722impl MessageData for HIL_GPS_DATA {
16723 type Message = MavMessage;
16724 const ID: u32 = 113u32;
16725 const NAME: &'static str = "HIL_GPS";
16726 const EXTRA_CRC: u8 = 124u8;
16727 const ENCODED_LEN: usize = 39usize;
16728 fn deser(
16729 _version: MavlinkVersion,
16730 __input: &[u8],
16731 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16732 let avail_len = __input.len();
16733 let mut payload_buf = [0; Self::ENCODED_LEN];
16734 let mut buf = if avail_len < Self::ENCODED_LEN {
16735 payload_buf[0..avail_len].copy_from_slice(__input);
16736 Bytes::new(&payload_buf)
16737 } else {
16738 Bytes::new(__input)
16739 };
16740 let mut __struct = Self::default();
16741 __struct.time_usec = buf.get_u64_le()?;
16742 __struct.lat = buf.get_i32_le()?;
16743 __struct.lon = buf.get_i32_le()?;
16744 __struct.alt = buf.get_i32_le()?;
16745 __struct.eph = buf.get_u16_le()?;
16746 __struct.epv = buf.get_u16_le()?;
16747 __struct.vel = buf.get_u16_le()?;
16748 __struct.vn = buf.get_i16_le()?;
16749 __struct.ve = buf.get_i16_le()?;
16750 __struct.vd = buf.get_i16_le()?;
16751 __struct.cog = buf.get_u16_le()?;
16752 __struct.fix_type = buf.get_u8()?;
16753 __struct.satellites_visible = buf.get_u8()?;
16754 __struct.id = buf.get_u8()?;
16755 __struct.yaw = buf.get_u16_le()?;
16756 Ok(__struct)
16757 }
16758 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16759 let mut __tmp = BytesMut::new(bytes);
16760 #[allow(clippy::absurd_extreme_comparisons)]
16761 #[allow(unused_comparisons)]
16762 if __tmp.remaining() < Self::ENCODED_LEN {
16763 panic!(
16764 "buffer is too small (need {} bytes, but got {})",
16765 Self::ENCODED_LEN,
16766 __tmp.remaining(),
16767 )
16768 }
16769 __tmp.put_u64_le(self.time_usec);
16770 __tmp.put_i32_le(self.lat);
16771 __tmp.put_i32_le(self.lon);
16772 __tmp.put_i32_le(self.alt);
16773 __tmp.put_u16_le(self.eph);
16774 __tmp.put_u16_le(self.epv);
16775 __tmp.put_u16_le(self.vel);
16776 __tmp.put_i16_le(self.vn);
16777 __tmp.put_i16_le(self.ve);
16778 __tmp.put_i16_le(self.vd);
16779 __tmp.put_u16_le(self.cog);
16780 __tmp.put_u8(self.fix_type);
16781 __tmp.put_u8(self.satellites_visible);
16782 if matches!(version, MavlinkVersion::V2) {
16783 __tmp.put_u8(self.id);
16784 __tmp.put_u16_le(self.yaw);
16785 let len = __tmp.len();
16786 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16787 } else {
16788 __tmp.len()
16789 }
16790 }
16791}
16792#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
16793#[doc = ""]
16794#[doc = "ID: 114"]
16795#[derive(Debug, Clone, PartialEq)]
16796#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16797#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16798#[cfg_attr(feature = "ts", derive(TS))]
16799#[cfg_attr(feature = "ts", ts(export))]
16800pub struct HIL_OPTICAL_FLOW_DATA {
16801 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16802 pub time_usec: u64,
16803 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
16804 pub integration_time_us: u32,
16805 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
16806 pub integrated_x: f32,
16807 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
16808 pub integrated_y: f32,
16809 #[doc = "RH rotation around X axis"]
16810 pub integrated_xgyro: f32,
16811 #[doc = "RH rotation around Y axis"]
16812 pub integrated_ygyro: f32,
16813 #[doc = "RH rotation around Z axis"]
16814 pub integrated_zgyro: f32,
16815 #[doc = "Time since the distance was sampled."]
16816 pub time_delta_distance_us: u32,
16817 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
16818 pub distance: f32,
16819 #[doc = "Temperature"]
16820 pub temperature: i16,
16821 #[doc = "Sensor ID"]
16822 pub sensor_id: u8,
16823 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
16824 pub quality: u8,
16825}
16826impl HIL_OPTICAL_FLOW_DATA {
16827 pub const ENCODED_LEN: usize = 44usize;
16828 pub const DEFAULT: Self = Self {
16829 time_usec: 0_u64,
16830 integration_time_us: 0_u32,
16831 integrated_x: 0.0_f32,
16832 integrated_y: 0.0_f32,
16833 integrated_xgyro: 0.0_f32,
16834 integrated_ygyro: 0.0_f32,
16835 integrated_zgyro: 0.0_f32,
16836 time_delta_distance_us: 0_u32,
16837 distance: 0.0_f32,
16838 temperature: 0_i16,
16839 sensor_id: 0_u8,
16840 quality: 0_u8,
16841 };
16842 #[cfg(feature = "arbitrary")]
16843 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16844 use arbitrary::{Arbitrary, Unstructured};
16845 let mut buf = [0u8; 1024];
16846 rng.fill_bytes(&mut buf);
16847 let mut unstructured = Unstructured::new(&buf);
16848 Self::arbitrary(&mut unstructured).unwrap_or_default()
16849 }
16850}
16851impl Default for HIL_OPTICAL_FLOW_DATA {
16852 fn default() -> Self {
16853 Self::DEFAULT.clone()
16854 }
16855}
16856impl MessageData for HIL_OPTICAL_FLOW_DATA {
16857 type Message = MavMessage;
16858 const ID: u32 = 114u32;
16859 const NAME: &'static str = "HIL_OPTICAL_FLOW";
16860 const EXTRA_CRC: u8 = 237u8;
16861 const ENCODED_LEN: usize = 44usize;
16862 fn deser(
16863 _version: MavlinkVersion,
16864 __input: &[u8],
16865 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16866 let avail_len = __input.len();
16867 let mut payload_buf = [0; Self::ENCODED_LEN];
16868 let mut buf = if avail_len < Self::ENCODED_LEN {
16869 payload_buf[0..avail_len].copy_from_slice(__input);
16870 Bytes::new(&payload_buf)
16871 } else {
16872 Bytes::new(__input)
16873 };
16874 let mut __struct = Self::default();
16875 __struct.time_usec = buf.get_u64_le()?;
16876 __struct.integration_time_us = buf.get_u32_le()?;
16877 __struct.integrated_x = buf.get_f32_le()?;
16878 __struct.integrated_y = buf.get_f32_le()?;
16879 __struct.integrated_xgyro = buf.get_f32_le()?;
16880 __struct.integrated_ygyro = buf.get_f32_le()?;
16881 __struct.integrated_zgyro = buf.get_f32_le()?;
16882 __struct.time_delta_distance_us = buf.get_u32_le()?;
16883 __struct.distance = buf.get_f32_le()?;
16884 __struct.temperature = buf.get_i16_le()?;
16885 __struct.sensor_id = buf.get_u8()?;
16886 __struct.quality = buf.get_u8()?;
16887 Ok(__struct)
16888 }
16889 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16890 let mut __tmp = BytesMut::new(bytes);
16891 #[allow(clippy::absurd_extreme_comparisons)]
16892 #[allow(unused_comparisons)]
16893 if __tmp.remaining() < Self::ENCODED_LEN {
16894 panic!(
16895 "buffer is too small (need {} bytes, but got {})",
16896 Self::ENCODED_LEN,
16897 __tmp.remaining(),
16898 )
16899 }
16900 __tmp.put_u64_le(self.time_usec);
16901 __tmp.put_u32_le(self.integration_time_us);
16902 __tmp.put_f32_le(self.integrated_x);
16903 __tmp.put_f32_le(self.integrated_y);
16904 __tmp.put_f32_le(self.integrated_xgyro);
16905 __tmp.put_f32_le(self.integrated_ygyro);
16906 __tmp.put_f32_le(self.integrated_zgyro);
16907 __tmp.put_u32_le(self.time_delta_distance_us);
16908 __tmp.put_f32_le(self.distance);
16909 __tmp.put_i16_le(self.temperature);
16910 __tmp.put_u8(self.sensor_id);
16911 __tmp.put_u8(self.quality);
16912 if matches!(version, MavlinkVersion::V2) {
16913 let len = __tmp.len();
16914 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16915 } else {
16916 __tmp.len()
16917 }
16918 }
16919}
16920#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
16921#[doc = ""]
16922#[doc = "ID: 92"]
16923#[derive(Debug, Clone, PartialEq)]
16924#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16925#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16926#[cfg_attr(feature = "ts", derive(TS))]
16927#[cfg_attr(feature = "ts", ts(export))]
16928pub struct HIL_RC_INPUTS_RAW_DATA {
16929 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16930 pub time_usec: u64,
16931 #[doc = "RC channel 1 value"]
16932 pub chan1_raw: u16,
16933 #[doc = "RC channel 2 value"]
16934 pub chan2_raw: u16,
16935 #[doc = "RC channel 3 value"]
16936 pub chan3_raw: u16,
16937 #[doc = "RC channel 4 value"]
16938 pub chan4_raw: u16,
16939 #[doc = "RC channel 5 value"]
16940 pub chan5_raw: u16,
16941 #[doc = "RC channel 6 value"]
16942 pub chan6_raw: u16,
16943 #[doc = "RC channel 7 value"]
16944 pub chan7_raw: u16,
16945 #[doc = "RC channel 8 value"]
16946 pub chan8_raw: u16,
16947 #[doc = "RC channel 9 value"]
16948 pub chan9_raw: u16,
16949 #[doc = "RC channel 10 value"]
16950 pub chan10_raw: u16,
16951 #[doc = "RC channel 11 value"]
16952 pub chan11_raw: u16,
16953 #[doc = "RC channel 12 value"]
16954 pub chan12_raw: u16,
16955 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
16956 pub rssi: u8,
16957}
16958impl HIL_RC_INPUTS_RAW_DATA {
16959 pub const ENCODED_LEN: usize = 33usize;
16960 pub const DEFAULT: Self = Self {
16961 time_usec: 0_u64,
16962 chan1_raw: 0_u16,
16963 chan2_raw: 0_u16,
16964 chan3_raw: 0_u16,
16965 chan4_raw: 0_u16,
16966 chan5_raw: 0_u16,
16967 chan6_raw: 0_u16,
16968 chan7_raw: 0_u16,
16969 chan8_raw: 0_u16,
16970 chan9_raw: 0_u16,
16971 chan10_raw: 0_u16,
16972 chan11_raw: 0_u16,
16973 chan12_raw: 0_u16,
16974 rssi: 0_u8,
16975 };
16976 #[cfg(feature = "arbitrary")]
16977 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16978 use arbitrary::{Arbitrary, Unstructured};
16979 let mut buf = [0u8; 1024];
16980 rng.fill_bytes(&mut buf);
16981 let mut unstructured = Unstructured::new(&buf);
16982 Self::arbitrary(&mut unstructured).unwrap_or_default()
16983 }
16984}
16985impl Default for HIL_RC_INPUTS_RAW_DATA {
16986 fn default() -> Self {
16987 Self::DEFAULT.clone()
16988 }
16989}
16990impl MessageData for HIL_RC_INPUTS_RAW_DATA {
16991 type Message = MavMessage;
16992 const ID: u32 = 92u32;
16993 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
16994 const EXTRA_CRC: u8 = 54u8;
16995 const ENCODED_LEN: usize = 33usize;
16996 fn deser(
16997 _version: MavlinkVersion,
16998 __input: &[u8],
16999 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17000 let avail_len = __input.len();
17001 let mut payload_buf = [0; Self::ENCODED_LEN];
17002 let mut buf = if avail_len < Self::ENCODED_LEN {
17003 payload_buf[0..avail_len].copy_from_slice(__input);
17004 Bytes::new(&payload_buf)
17005 } else {
17006 Bytes::new(__input)
17007 };
17008 let mut __struct = Self::default();
17009 __struct.time_usec = buf.get_u64_le()?;
17010 __struct.chan1_raw = buf.get_u16_le()?;
17011 __struct.chan2_raw = buf.get_u16_le()?;
17012 __struct.chan3_raw = buf.get_u16_le()?;
17013 __struct.chan4_raw = buf.get_u16_le()?;
17014 __struct.chan5_raw = buf.get_u16_le()?;
17015 __struct.chan6_raw = buf.get_u16_le()?;
17016 __struct.chan7_raw = buf.get_u16_le()?;
17017 __struct.chan8_raw = buf.get_u16_le()?;
17018 __struct.chan9_raw = buf.get_u16_le()?;
17019 __struct.chan10_raw = buf.get_u16_le()?;
17020 __struct.chan11_raw = buf.get_u16_le()?;
17021 __struct.chan12_raw = buf.get_u16_le()?;
17022 __struct.rssi = buf.get_u8()?;
17023 Ok(__struct)
17024 }
17025 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17026 let mut __tmp = BytesMut::new(bytes);
17027 #[allow(clippy::absurd_extreme_comparisons)]
17028 #[allow(unused_comparisons)]
17029 if __tmp.remaining() < Self::ENCODED_LEN {
17030 panic!(
17031 "buffer is too small (need {} bytes, but got {})",
17032 Self::ENCODED_LEN,
17033 __tmp.remaining(),
17034 )
17035 }
17036 __tmp.put_u64_le(self.time_usec);
17037 __tmp.put_u16_le(self.chan1_raw);
17038 __tmp.put_u16_le(self.chan2_raw);
17039 __tmp.put_u16_le(self.chan3_raw);
17040 __tmp.put_u16_le(self.chan4_raw);
17041 __tmp.put_u16_le(self.chan5_raw);
17042 __tmp.put_u16_le(self.chan6_raw);
17043 __tmp.put_u16_le(self.chan7_raw);
17044 __tmp.put_u16_le(self.chan8_raw);
17045 __tmp.put_u16_le(self.chan9_raw);
17046 __tmp.put_u16_le(self.chan10_raw);
17047 __tmp.put_u16_le(self.chan11_raw);
17048 __tmp.put_u16_le(self.chan12_raw);
17049 __tmp.put_u8(self.rssi);
17050 if matches!(version, MavlinkVersion::V2) {
17051 let len = __tmp.len();
17052 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17053 } else {
17054 __tmp.len()
17055 }
17056 }
17057}
17058#[doc = "The IMU readings in SI units in NED body frame."]
17059#[doc = ""]
17060#[doc = "ID: 107"]
17061#[derive(Debug, Clone, PartialEq)]
17062#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17063#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17064#[cfg_attr(feature = "ts", derive(TS))]
17065#[cfg_attr(feature = "ts", ts(export))]
17066pub struct HIL_SENSOR_DATA {
17067 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17068 pub time_usec: u64,
17069 #[doc = "X acceleration"]
17070 pub xacc: f32,
17071 #[doc = "Y acceleration"]
17072 pub yacc: f32,
17073 #[doc = "Z acceleration"]
17074 pub zacc: f32,
17075 #[doc = "Angular speed around X axis in body frame"]
17076 pub xgyro: f32,
17077 #[doc = "Angular speed around Y axis in body frame"]
17078 pub ygyro: f32,
17079 #[doc = "Angular speed around Z axis in body frame"]
17080 pub zgyro: f32,
17081 #[doc = "X Magnetic field"]
17082 pub xmag: f32,
17083 #[doc = "Y Magnetic field"]
17084 pub ymag: f32,
17085 #[doc = "Z Magnetic field"]
17086 pub zmag: f32,
17087 #[doc = "Absolute pressure"]
17088 pub abs_pressure: f32,
17089 #[doc = "Differential pressure (airspeed)"]
17090 pub diff_pressure: f32,
17091 #[doc = "Altitude calculated from pressure"]
17092 pub pressure_alt: f32,
17093 #[doc = "Temperature"]
17094 pub temperature: f32,
17095 #[doc = "Bitmap for fields that have updated since last message"]
17096 pub fields_updated: HilSensorUpdatedFlags,
17097 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
17098 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17099 pub id: u8,
17100}
17101impl HIL_SENSOR_DATA {
17102 pub const ENCODED_LEN: usize = 65usize;
17103 pub const DEFAULT: Self = Self {
17104 time_usec: 0_u64,
17105 xacc: 0.0_f32,
17106 yacc: 0.0_f32,
17107 zacc: 0.0_f32,
17108 xgyro: 0.0_f32,
17109 ygyro: 0.0_f32,
17110 zgyro: 0.0_f32,
17111 xmag: 0.0_f32,
17112 ymag: 0.0_f32,
17113 zmag: 0.0_f32,
17114 abs_pressure: 0.0_f32,
17115 diff_pressure: 0.0_f32,
17116 pressure_alt: 0.0_f32,
17117 temperature: 0.0_f32,
17118 fields_updated: HilSensorUpdatedFlags::DEFAULT,
17119 id: 0_u8,
17120 };
17121 #[cfg(feature = "arbitrary")]
17122 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17123 use arbitrary::{Arbitrary, Unstructured};
17124 let mut buf = [0u8; 1024];
17125 rng.fill_bytes(&mut buf);
17126 let mut unstructured = Unstructured::new(&buf);
17127 Self::arbitrary(&mut unstructured).unwrap_or_default()
17128 }
17129}
17130impl Default for HIL_SENSOR_DATA {
17131 fn default() -> Self {
17132 Self::DEFAULT.clone()
17133 }
17134}
17135impl MessageData for HIL_SENSOR_DATA {
17136 type Message = MavMessage;
17137 const ID: u32 = 107u32;
17138 const NAME: &'static str = "HIL_SENSOR";
17139 const EXTRA_CRC: u8 = 108u8;
17140 const ENCODED_LEN: usize = 65usize;
17141 fn deser(
17142 _version: MavlinkVersion,
17143 __input: &[u8],
17144 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17145 let avail_len = __input.len();
17146 let mut payload_buf = [0; Self::ENCODED_LEN];
17147 let mut buf = if avail_len < Self::ENCODED_LEN {
17148 payload_buf[0..avail_len].copy_from_slice(__input);
17149 Bytes::new(&payload_buf)
17150 } else {
17151 Bytes::new(__input)
17152 };
17153 let mut __struct = Self::default();
17154 __struct.time_usec = buf.get_u64_le()?;
17155 __struct.xacc = buf.get_f32_le()?;
17156 __struct.yacc = buf.get_f32_le()?;
17157 __struct.zacc = buf.get_f32_le()?;
17158 __struct.xgyro = buf.get_f32_le()?;
17159 __struct.ygyro = buf.get_f32_le()?;
17160 __struct.zgyro = buf.get_f32_le()?;
17161 __struct.xmag = buf.get_f32_le()?;
17162 __struct.ymag = buf.get_f32_le()?;
17163 __struct.zmag = buf.get_f32_le()?;
17164 __struct.abs_pressure = buf.get_f32_le()?;
17165 __struct.diff_pressure = buf.get_f32_le()?;
17166 __struct.pressure_alt = buf.get_f32_le()?;
17167 __struct.temperature = buf.get_f32_le()?;
17168 let tmp = buf.get_u32_le()?;
17169 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
17170 tmp as <HilSensorUpdatedFlags as Flags>::Bits,
17171 )
17172 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17173 flag_type: "HilSensorUpdatedFlags",
17174 value: tmp as u64,
17175 })?;
17176 __struct.id = buf.get_u8()?;
17177 Ok(__struct)
17178 }
17179 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17180 let mut __tmp = BytesMut::new(bytes);
17181 #[allow(clippy::absurd_extreme_comparisons)]
17182 #[allow(unused_comparisons)]
17183 if __tmp.remaining() < Self::ENCODED_LEN {
17184 panic!(
17185 "buffer is too small (need {} bytes, but got {})",
17186 Self::ENCODED_LEN,
17187 __tmp.remaining(),
17188 )
17189 }
17190 __tmp.put_u64_le(self.time_usec);
17191 __tmp.put_f32_le(self.xacc);
17192 __tmp.put_f32_le(self.yacc);
17193 __tmp.put_f32_le(self.zacc);
17194 __tmp.put_f32_le(self.xgyro);
17195 __tmp.put_f32_le(self.ygyro);
17196 __tmp.put_f32_le(self.zgyro);
17197 __tmp.put_f32_le(self.xmag);
17198 __tmp.put_f32_le(self.ymag);
17199 __tmp.put_f32_le(self.zmag);
17200 __tmp.put_f32_le(self.abs_pressure);
17201 __tmp.put_f32_le(self.diff_pressure);
17202 __tmp.put_f32_le(self.pressure_alt);
17203 __tmp.put_f32_le(self.temperature);
17204 __tmp.put_u32_le(self.fields_updated.bits() as u32);
17205 if matches!(version, MavlinkVersion::V2) {
17206 __tmp.put_u8(self.id);
17207 let len = __tmp.len();
17208 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17209 } else {
17210 __tmp.len()
17211 }
17212 }
17213}
17214#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
17215#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
17216#[doc = ""]
17217#[doc = "ID: 90"]
17218#[derive(Debug, Clone, PartialEq)]
17219#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17220#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17221#[cfg_attr(feature = "ts", derive(TS))]
17222#[cfg_attr(feature = "ts", ts(export))]
17223pub struct HIL_STATE_DATA {
17224 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17225 pub time_usec: u64,
17226 #[doc = "Roll angle"]
17227 pub roll: f32,
17228 #[doc = "Pitch angle"]
17229 pub pitch: f32,
17230 #[doc = "Yaw angle"]
17231 pub yaw: f32,
17232 #[doc = "Body frame roll / phi angular speed"]
17233 pub rollspeed: f32,
17234 #[doc = "Body frame pitch / theta angular speed"]
17235 pub pitchspeed: f32,
17236 #[doc = "Body frame yaw / psi angular speed"]
17237 pub yawspeed: f32,
17238 #[doc = "Latitude"]
17239 pub lat: i32,
17240 #[doc = "Longitude"]
17241 pub lon: i32,
17242 #[doc = "Altitude"]
17243 pub alt: i32,
17244 #[doc = "Ground X Speed (Latitude)"]
17245 pub vx: i16,
17246 #[doc = "Ground Y Speed (Longitude)"]
17247 pub vy: i16,
17248 #[doc = "Ground Z Speed (Altitude)"]
17249 pub vz: i16,
17250 #[doc = "X acceleration"]
17251 pub xacc: i16,
17252 #[doc = "Y acceleration"]
17253 pub yacc: i16,
17254 #[doc = "Z acceleration"]
17255 pub zacc: i16,
17256}
17257impl HIL_STATE_DATA {
17258 pub const ENCODED_LEN: usize = 56usize;
17259 pub const DEFAULT: Self = Self {
17260 time_usec: 0_u64,
17261 roll: 0.0_f32,
17262 pitch: 0.0_f32,
17263 yaw: 0.0_f32,
17264 rollspeed: 0.0_f32,
17265 pitchspeed: 0.0_f32,
17266 yawspeed: 0.0_f32,
17267 lat: 0_i32,
17268 lon: 0_i32,
17269 alt: 0_i32,
17270 vx: 0_i16,
17271 vy: 0_i16,
17272 vz: 0_i16,
17273 xacc: 0_i16,
17274 yacc: 0_i16,
17275 zacc: 0_i16,
17276 };
17277 #[cfg(feature = "arbitrary")]
17278 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17279 use arbitrary::{Arbitrary, Unstructured};
17280 let mut buf = [0u8; 1024];
17281 rng.fill_bytes(&mut buf);
17282 let mut unstructured = Unstructured::new(&buf);
17283 Self::arbitrary(&mut unstructured).unwrap_or_default()
17284 }
17285}
17286impl Default for HIL_STATE_DATA {
17287 fn default() -> Self {
17288 Self::DEFAULT.clone()
17289 }
17290}
17291impl MessageData for HIL_STATE_DATA {
17292 type Message = MavMessage;
17293 const ID: u32 = 90u32;
17294 const NAME: &'static str = "HIL_STATE";
17295 const EXTRA_CRC: u8 = 183u8;
17296 const ENCODED_LEN: usize = 56usize;
17297 fn deser(
17298 _version: MavlinkVersion,
17299 __input: &[u8],
17300 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17301 let avail_len = __input.len();
17302 let mut payload_buf = [0; Self::ENCODED_LEN];
17303 let mut buf = if avail_len < Self::ENCODED_LEN {
17304 payload_buf[0..avail_len].copy_from_slice(__input);
17305 Bytes::new(&payload_buf)
17306 } else {
17307 Bytes::new(__input)
17308 };
17309 let mut __struct = Self::default();
17310 __struct.time_usec = buf.get_u64_le()?;
17311 __struct.roll = buf.get_f32_le()?;
17312 __struct.pitch = buf.get_f32_le()?;
17313 __struct.yaw = buf.get_f32_le()?;
17314 __struct.rollspeed = buf.get_f32_le()?;
17315 __struct.pitchspeed = buf.get_f32_le()?;
17316 __struct.yawspeed = buf.get_f32_le()?;
17317 __struct.lat = buf.get_i32_le()?;
17318 __struct.lon = buf.get_i32_le()?;
17319 __struct.alt = buf.get_i32_le()?;
17320 __struct.vx = buf.get_i16_le()?;
17321 __struct.vy = buf.get_i16_le()?;
17322 __struct.vz = buf.get_i16_le()?;
17323 __struct.xacc = buf.get_i16_le()?;
17324 __struct.yacc = buf.get_i16_le()?;
17325 __struct.zacc = buf.get_i16_le()?;
17326 Ok(__struct)
17327 }
17328 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17329 let mut __tmp = BytesMut::new(bytes);
17330 #[allow(clippy::absurd_extreme_comparisons)]
17331 #[allow(unused_comparisons)]
17332 if __tmp.remaining() < Self::ENCODED_LEN {
17333 panic!(
17334 "buffer is too small (need {} bytes, but got {})",
17335 Self::ENCODED_LEN,
17336 __tmp.remaining(),
17337 )
17338 }
17339 __tmp.put_u64_le(self.time_usec);
17340 __tmp.put_f32_le(self.roll);
17341 __tmp.put_f32_le(self.pitch);
17342 __tmp.put_f32_le(self.yaw);
17343 __tmp.put_f32_le(self.rollspeed);
17344 __tmp.put_f32_le(self.pitchspeed);
17345 __tmp.put_f32_le(self.yawspeed);
17346 __tmp.put_i32_le(self.lat);
17347 __tmp.put_i32_le(self.lon);
17348 __tmp.put_i32_le(self.alt);
17349 __tmp.put_i16_le(self.vx);
17350 __tmp.put_i16_le(self.vy);
17351 __tmp.put_i16_le(self.vz);
17352 __tmp.put_i16_le(self.xacc);
17353 __tmp.put_i16_le(self.yacc);
17354 __tmp.put_i16_le(self.zacc);
17355 if matches!(version, MavlinkVersion::V2) {
17356 let len = __tmp.len();
17357 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17358 } else {
17359 __tmp.len()
17360 }
17361 }
17362}
17363#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
17364#[doc = ""]
17365#[doc = "ID: 115"]
17366#[derive(Debug, Clone, PartialEq)]
17367#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17368#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17369#[cfg_attr(feature = "ts", derive(TS))]
17370#[cfg_attr(feature = "ts", ts(export))]
17371pub struct HIL_STATE_QUATERNION_DATA {
17372 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17373 pub time_usec: u64,
17374 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
17375 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17376 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17377 pub attitude_quaternion: [f32; 4],
17378 #[doc = "Body frame roll / phi angular speed"]
17379 pub rollspeed: f32,
17380 #[doc = "Body frame pitch / theta angular speed"]
17381 pub pitchspeed: f32,
17382 #[doc = "Body frame yaw / psi angular speed"]
17383 pub yawspeed: f32,
17384 #[doc = "Latitude"]
17385 pub lat: i32,
17386 #[doc = "Longitude"]
17387 pub lon: i32,
17388 #[doc = "Altitude"]
17389 pub alt: i32,
17390 #[doc = "Ground X Speed (Latitude)"]
17391 pub vx: i16,
17392 #[doc = "Ground Y Speed (Longitude)"]
17393 pub vy: i16,
17394 #[doc = "Ground Z Speed (Altitude)"]
17395 pub vz: i16,
17396 #[doc = "Indicated airspeed"]
17397 pub ind_airspeed: u16,
17398 #[doc = "True airspeed"]
17399 pub true_airspeed: u16,
17400 #[doc = "X acceleration"]
17401 pub xacc: i16,
17402 #[doc = "Y acceleration"]
17403 pub yacc: i16,
17404 #[doc = "Z acceleration"]
17405 pub zacc: i16,
17406}
17407impl HIL_STATE_QUATERNION_DATA {
17408 pub const ENCODED_LEN: usize = 64usize;
17409 pub const DEFAULT: Self = Self {
17410 time_usec: 0_u64,
17411 attitude_quaternion: [0.0_f32; 4usize],
17412 rollspeed: 0.0_f32,
17413 pitchspeed: 0.0_f32,
17414 yawspeed: 0.0_f32,
17415 lat: 0_i32,
17416 lon: 0_i32,
17417 alt: 0_i32,
17418 vx: 0_i16,
17419 vy: 0_i16,
17420 vz: 0_i16,
17421 ind_airspeed: 0_u16,
17422 true_airspeed: 0_u16,
17423 xacc: 0_i16,
17424 yacc: 0_i16,
17425 zacc: 0_i16,
17426 };
17427 #[cfg(feature = "arbitrary")]
17428 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17429 use arbitrary::{Arbitrary, Unstructured};
17430 let mut buf = [0u8; 1024];
17431 rng.fill_bytes(&mut buf);
17432 let mut unstructured = Unstructured::new(&buf);
17433 Self::arbitrary(&mut unstructured).unwrap_or_default()
17434 }
17435}
17436impl Default for HIL_STATE_QUATERNION_DATA {
17437 fn default() -> Self {
17438 Self::DEFAULT.clone()
17439 }
17440}
17441impl MessageData for HIL_STATE_QUATERNION_DATA {
17442 type Message = MavMessage;
17443 const ID: u32 = 115u32;
17444 const NAME: &'static str = "HIL_STATE_QUATERNION";
17445 const EXTRA_CRC: u8 = 4u8;
17446 const ENCODED_LEN: usize = 64usize;
17447 fn deser(
17448 _version: MavlinkVersion,
17449 __input: &[u8],
17450 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17451 let avail_len = __input.len();
17452 let mut payload_buf = [0; Self::ENCODED_LEN];
17453 let mut buf = if avail_len < Self::ENCODED_LEN {
17454 payload_buf[0..avail_len].copy_from_slice(__input);
17455 Bytes::new(&payload_buf)
17456 } else {
17457 Bytes::new(__input)
17458 };
17459 let mut __struct = Self::default();
17460 __struct.time_usec = buf.get_u64_le()?;
17461 for v in &mut __struct.attitude_quaternion {
17462 let val = buf.get_f32_le()?;
17463 *v = val;
17464 }
17465 __struct.rollspeed = buf.get_f32_le()?;
17466 __struct.pitchspeed = buf.get_f32_le()?;
17467 __struct.yawspeed = buf.get_f32_le()?;
17468 __struct.lat = buf.get_i32_le()?;
17469 __struct.lon = buf.get_i32_le()?;
17470 __struct.alt = buf.get_i32_le()?;
17471 __struct.vx = buf.get_i16_le()?;
17472 __struct.vy = buf.get_i16_le()?;
17473 __struct.vz = buf.get_i16_le()?;
17474 __struct.ind_airspeed = buf.get_u16_le()?;
17475 __struct.true_airspeed = buf.get_u16_le()?;
17476 __struct.xacc = buf.get_i16_le()?;
17477 __struct.yacc = buf.get_i16_le()?;
17478 __struct.zacc = buf.get_i16_le()?;
17479 Ok(__struct)
17480 }
17481 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17482 let mut __tmp = BytesMut::new(bytes);
17483 #[allow(clippy::absurd_extreme_comparisons)]
17484 #[allow(unused_comparisons)]
17485 if __tmp.remaining() < Self::ENCODED_LEN {
17486 panic!(
17487 "buffer is too small (need {} bytes, but got {})",
17488 Self::ENCODED_LEN,
17489 __tmp.remaining(),
17490 )
17491 }
17492 __tmp.put_u64_le(self.time_usec);
17493 for val in &self.attitude_quaternion {
17494 __tmp.put_f32_le(*val);
17495 }
17496 __tmp.put_f32_le(self.rollspeed);
17497 __tmp.put_f32_le(self.pitchspeed);
17498 __tmp.put_f32_le(self.yawspeed);
17499 __tmp.put_i32_le(self.lat);
17500 __tmp.put_i32_le(self.lon);
17501 __tmp.put_i32_le(self.alt);
17502 __tmp.put_i16_le(self.vx);
17503 __tmp.put_i16_le(self.vy);
17504 __tmp.put_i16_le(self.vz);
17505 __tmp.put_u16_le(self.ind_airspeed);
17506 __tmp.put_u16_le(self.true_airspeed);
17507 __tmp.put_i16_le(self.xacc);
17508 __tmp.put_i16_le(self.yacc);
17509 __tmp.put_i16_le(self.zacc);
17510 if matches!(version, MavlinkVersion::V2) {
17511 let len = __tmp.len();
17512 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17513 } else {
17514 __tmp.len()
17515 }
17516 }
17517}
17518#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
17519#[doc = ""]
17520#[doc = "ID: 242"]
17521#[derive(Debug, Clone, PartialEq)]
17522#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17523#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17524#[cfg_attr(feature = "ts", derive(TS))]
17525#[cfg_attr(feature = "ts", ts(export))]
17526pub struct HOME_POSITION_DATA {
17527 #[doc = "Latitude (WGS84)"]
17528 pub latitude: i32,
17529 #[doc = "Longitude (WGS84)"]
17530 pub longitude: i32,
17531 #[doc = "Altitude (MSL). Positive for up."]
17532 pub altitude: i32,
17533 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
17534 pub x: f32,
17535 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
17536 pub y: f32,
17537 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
17538 pub z: f32,
17539 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
17540 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17541 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
17542 pub q: [f32; 4],
17543 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17544 pub approach_x: f32,
17545 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17546 pub approach_y: f32,
17547 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
17548 pub approach_z: f32,
17549 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17550 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17551 pub time_usec: u64,
17552}
17553impl HOME_POSITION_DATA {
17554 pub const ENCODED_LEN: usize = 60usize;
17555 pub const DEFAULT: Self = Self {
17556 latitude: 0_i32,
17557 longitude: 0_i32,
17558 altitude: 0_i32,
17559 x: 0.0_f32,
17560 y: 0.0_f32,
17561 z: 0.0_f32,
17562 q: [0.0_f32; 4usize],
17563 approach_x: 0.0_f32,
17564 approach_y: 0.0_f32,
17565 approach_z: 0.0_f32,
17566 time_usec: 0_u64,
17567 };
17568 #[cfg(feature = "arbitrary")]
17569 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17570 use arbitrary::{Arbitrary, Unstructured};
17571 let mut buf = [0u8; 1024];
17572 rng.fill_bytes(&mut buf);
17573 let mut unstructured = Unstructured::new(&buf);
17574 Self::arbitrary(&mut unstructured).unwrap_or_default()
17575 }
17576}
17577impl Default for HOME_POSITION_DATA {
17578 fn default() -> Self {
17579 Self::DEFAULT.clone()
17580 }
17581}
17582impl MessageData for HOME_POSITION_DATA {
17583 type Message = MavMessage;
17584 const ID: u32 = 242u32;
17585 const NAME: &'static str = "HOME_POSITION";
17586 const EXTRA_CRC: u8 = 104u8;
17587 const ENCODED_LEN: usize = 60usize;
17588 fn deser(
17589 _version: MavlinkVersion,
17590 __input: &[u8],
17591 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17592 let avail_len = __input.len();
17593 let mut payload_buf = [0; Self::ENCODED_LEN];
17594 let mut buf = if avail_len < Self::ENCODED_LEN {
17595 payload_buf[0..avail_len].copy_from_slice(__input);
17596 Bytes::new(&payload_buf)
17597 } else {
17598 Bytes::new(__input)
17599 };
17600 let mut __struct = Self::default();
17601 __struct.latitude = buf.get_i32_le()?;
17602 __struct.longitude = buf.get_i32_le()?;
17603 __struct.altitude = buf.get_i32_le()?;
17604 __struct.x = buf.get_f32_le()?;
17605 __struct.y = buf.get_f32_le()?;
17606 __struct.z = buf.get_f32_le()?;
17607 for v in &mut __struct.q {
17608 let val = buf.get_f32_le()?;
17609 *v = val;
17610 }
17611 __struct.approach_x = buf.get_f32_le()?;
17612 __struct.approach_y = buf.get_f32_le()?;
17613 __struct.approach_z = buf.get_f32_le()?;
17614 __struct.time_usec = buf.get_u64_le()?;
17615 Ok(__struct)
17616 }
17617 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17618 let mut __tmp = BytesMut::new(bytes);
17619 #[allow(clippy::absurd_extreme_comparisons)]
17620 #[allow(unused_comparisons)]
17621 if __tmp.remaining() < Self::ENCODED_LEN {
17622 panic!(
17623 "buffer is too small (need {} bytes, but got {})",
17624 Self::ENCODED_LEN,
17625 __tmp.remaining(),
17626 )
17627 }
17628 __tmp.put_i32_le(self.latitude);
17629 __tmp.put_i32_le(self.longitude);
17630 __tmp.put_i32_le(self.altitude);
17631 __tmp.put_f32_le(self.x);
17632 __tmp.put_f32_le(self.y);
17633 __tmp.put_f32_le(self.z);
17634 for val in &self.q {
17635 __tmp.put_f32_le(*val);
17636 }
17637 __tmp.put_f32_le(self.approach_x);
17638 __tmp.put_f32_le(self.approach_y);
17639 __tmp.put_f32_le(self.approach_z);
17640 if matches!(version, MavlinkVersion::V2) {
17641 __tmp.put_u64_le(self.time_usec);
17642 let len = __tmp.len();
17643 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17644 } else {
17645 __tmp.len()
17646 }
17647 }
17648}
17649#[doc = "Temperature and humidity from hygrometer."]
17650#[doc = ""]
17651#[doc = "ID: 12920"]
17652#[derive(Debug, Clone, PartialEq)]
17653#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17654#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17655#[cfg_attr(feature = "ts", derive(TS))]
17656#[cfg_attr(feature = "ts", ts(export))]
17657pub struct HYGROMETER_SENSOR_DATA {
17658 #[doc = "Temperature"]
17659 pub temperature: i16,
17660 #[doc = "Humidity"]
17661 pub humidity: u16,
17662 #[doc = "Hygrometer ID"]
17663 pub id: u8,
17664}
17665impl HYGROMETER_SENSOR_DATA {
17666 pub const ENCODED_LEN: usize = 5usize;
17667 pub const DEFAULT: Self = Self {
17668 temperature: 0_i16,
17669 humidity: 0_u16,
17670 id: 0_u8,
17671 };
17672 #[cfg(feature = "arbitrary")]
17673 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17674 use arbitrary::{Arbitrary, Unstructured};
17675 let mut buf = [0u8; 1024];
17676 rng.fill_bytes(&mut buf);
17677 let mut unstructured = Unstructured::new(&buf);
17678 Self::arbitrary(&mut unstructured).unwrap_or_default()
17679 }
17680}
17681impl Default for HYGROMETER_SENSOR_DATA {
17682 fn default() -> Self {
17683 Self::DEFAULT.clone()
17684 }
17685}
17686impl MessageData for HYGROMETER_SENSOR_DATA {
17687 type Message = MavMessage;
17688 const ID: u32 = 12920u32;
17689 const NAME: &'static str = "HYGROMETER_SENSOR";
17690 const EXTRA_CRC: u8 = 20u8;
17691 const ENCODED_LEN: usize = 5usize;
17692 fn deser(
17693 _version: MavlinkVersion,
17694 __input: &[u8],
17695 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17696 let avail_len = __input.len();
17697 let mut payload_buf = [0; Self::ENCODED_LEN];
17698 let mut buf = if avail_len < Self::ENCODED_LEN {
17699 payload_buf[0..avail_len].copy_from_slice(__input);
17700 Bytes::new(&payload_buf)
17701 } else {
17702 Bytes::new(__input)
17703 };
17704 let mut __struct = Self::default();
17705 __struct.temperature = buf.get_i16_le()?;
17706 __struct.humidity = buf.get_u16_le()?;
17707 __struct.id = buf.get_u8()?;
17708 Ok(__struct)
17709 }
17710 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17711 let mut __tmp = BytesMut::new(bytes);
17712 #[allow(clippy::absurd_extreme_comparisons)]
17713 #[allow(unused_comparisons)]
17714 if __tmp.remaining() < Self::ENCODED_LEN {
17715 panic!(
17716 "buffer is too small (need {} bytes, but got {})",
17717 Self::ENCODED_LEN,
17718 __tmp.remaining(),
17719 )
17720 }
17721 __tmp.put_i16_le(self.temperature);
17722 __tmp.put_u16_le(self.humidity);
17723 __tmp.put_u8(self.id);
17724 if matches!(version, MavlinkVersion::V2) {
17725 let len = __tmp.len();
17726 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17727 } else {
17728 __tmp.len()
17729 }
17730 }
17731}
17732#[doc = "Illuminator status."]
17733#[doc = ""]
17734#[doc = "ID: 440"]
17735#[derive(Debug, Clone, PartialEq)]
17736#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17737#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17738#[cfg_attr(feature = "ts", derive(TS))]
17739#[cfg_attr(feature = "ts", ts(export))]
17740pub struct ILLUMINATOR_STATUS_DATA {
17741 #[doc = "Time since the start-up of the illuminator in ms"]
17742 pub uptime_ms: u32,
17743 #[doc = "Errors"]
17744 pub error_status: IlluminatorErrorFlags,
17745 #[doc = "Illuminator brightness"]
17746 pub brightness: f32,
17747 #[doc = "Illuminator strobing period in seconds"]
17748 pub strobe_period: f32,
17749 #[doc = "Illuminator strobing duty cycle"]
17750 pub strobe_duty_cycle: f32,
17751 #[doc = "Temperature in Celsius"]
17752 pub temp_c: f32,
17753 #[doc = "Minimum strobing period in seconds"]
17754 pub min_strobe_period: f32,
17755 #[doc = "Maximum strobing period in seconds"]
17756 pub max_strobe_period: f32,
17757 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
17758 pub enable: u8,
17759 #[doc = "Supported illuminator modes"]
17760 pub mode_bitmask: IlluminatorMode,
17761 #[doc = "Illuminator mode"]
17762 pub mode: IlluminatorMode,
17763}
17764impl ILLUMINATOR_STATUS_DATA {
17765 pub const ENCODED_LEN: usize = 35usize;
17766 pub const DEFAULT: Self = Self {
17767 uptime_ms: 0_u32,
17768 error_status: IlluminatorErrorFlags::DEFAULT,
17769 brightness: 0.0_f32,
17770 strobe_period: 0.0_f32,
17771 strobe_duty_cycle: 0.0_f32,
17772 temp_c: 0.0_f32,
17773 min_strobe_period: 0.0_f32,
17774 max_strobe_period: 0.0_f32,
17775 enable: 0_u8,
17776 mode_bitmask: IlluminatorMode::DEFAULT,
17777 mode: IlluminatorMode::DEFAULT,
17778 };
17779 #[cfg(feature = "arbitrary")]
17780 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17781 use arbitrary::{Arbitrary, Unstructured};
17782 let mut buf = [0u8; 1024];
17783 rng.fill_bytes(&mut buf);
17784 let mut unstructured = Unstructured::new(&buf);
17785 Self::arbitrary(&mut unstructured).unwrap_or_default()
17786 }
17787}
17788impl Default for ILLUMINATOR_STATUS_DATA {
17789 fn default() -> Self {
17790 Self::DEFAULT.clone()
17791 }
17792}
17793impl MessageData for ILLUMINATOR_STATUS_DATA {
17794 type Message = MavMessage;
17795 const ID: u32 = 440u32;
17796 const NAME: &'static str = "ILLUMINATOR_STATUS";
17797 const EXTRA_CRC: u8 = 66u8;
17798 const ENCODED_LEN: usize = 35usize;
17799 fn deser(
17800 _version: MavlinkVersion,
17801 __input: &[u8],
17802 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17803 let avail_len = __input.len();
17804 let mut payload_buf = [0; Self::ENCODED_LEN];
17805 let mut buf = if avail_len < Self::ENCODED_LEN {
17806 payload_buf[0..avail_len].copy_from_slice(__input);
17807 Bytes::new(&payload_buf)
17808 } else {
17809 Bytes::new(__input)
17810 };
17811 let mut __struct = Self::default();
17812 __struct.uptime_ms = buf.get_u32_le()?;
17813 let tmp = buf.get_u32_le()?;
17814 __struct.error_status = IlluminatorErrorFlags::from_bits(
17815 tmp as <IlluminatorErrorFlags as Flags>::Bits,
17816 )
17817 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17818 flag_type: "IlluminatorErrorFlags",
17819 value: tmp as u64,
17820 })?;
17821 __struct.brightness = buf.get_f32_le()?;
17822 __struct.strobe_period = buf.get_f32_le()?;
17823 __struct.strobe_duty_cycle = buf.get_f32_le()?;
17824 __struct.temp_c = buf.get_f32_le()?;
17825 __struct.min_strobe_period = buf.get_f32_le()?;
17826 __struct.max_strobe_period = buf.get_f32_le()?;
17827 __struct.enable = buf.get_u8()?;
17828 let tmp = buf.get_u8()?;
17829 __struct.mode_bitmask =
17830 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17831 enum_type: "IlluminatorMode",
17832 value: tmp as u64,
17833 })?;
17834 let tmp = buf.get_u8()?;
17835 __struct.mode =
17836 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17837 enum_type: "IlluminatorMode",
17838 value: tmp as u64,
17839 })?;
17840 Ok(__struct)
17841 }
17842 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17843 let mut __tmp = BytesMut::new(bytes);
17844 #[allow(clippy::absurd_extreme_comparisons)]
17845 #[allow(unused_comparisons)]
17846 if __tmp.remaining() < Self::ENCODED_LEN {
17847 panic!(
17848 "buffer is too small (need {} bytes, but got {})",
17849 Self::ENCODED_LEN,
17850 __tmp.remaining(),
17851 )
17852 }
17853 __tmp.put_u32_le(self.uptime_ms);
17854 __tmp.put_u32_le(self.error_status.bits() as u32);
17855 __tmp.put_f32_le(self.brightness);
17856 __tmp.put_f32_le(self.strobe_period);
17857 __tmp.put_f32_le(self.strobe_duty_cycle);
17858 __tmp.put_f32_le(self.temp_c);
17859 __tmp.put_f32_le(self.min_strobe_period);
17860 __tmp.put_f32_le(self.max_strobe_period);
17861 __tmp.put_u8(self.enable);
17862 __tmp.put_u8(self.mode_bitmask as u8);
17863 __tmp.put_u8(self.mode as u8);
17864 if matches!(version, MavlinkVersion::V2) {
17865 let len = __tmp.len();
17866 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17867 } else {
17868 __tmp.len()
17869 }
17870 }
17871}
17872#[doc = "Status of the Iridium SBD link."]
17873#[doc = ""]
17874#[doc = "ID: 335"]
17875#[derive(Debug, Clone, PartialEq)]
17876#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17877#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17878#[cfg_attr(feature = "ts", derive(TS))]
17879#[cfg_attr(feature = "ts", ts(export))]
17880pub struct ISBD_LINK_STATUS_DATA {
17881 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17882 pub timestamp: u64,
17883 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17884 pub last_heartbeat: u64,
17885 #[doc = "Number of failed SBD sessions."]
17886 pub failed_sessions: u16,
17887 #[doc = "Number of successful SBD sessions."]
17888 pub successful_sessions: u16,
17889 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
17890 pub signal_quality: u8,
17891 #[doc = "1: Ring call pending, 0: No call pending."]
17892 pub ring_pending: u8,
17893 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
17894 pub tx_session_pending: u8,
17895 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
17896 pub rx_session_pending: u8,
17897}
17898impl ISBD_LINK_STATUS_DATA {
17899 pub const ENCODED_LEN: usize = 24usize;
17900 pub const DEFAULT: Self = Self {
17901 timestamp: 0_u64,
17902 last_heartbeat: 0_u64,
17903 failed_sessions: 0_u16,
17904 successful_sessions: 0_u16,
17905 signal_quality: 0_u8,
17906 ring_pending: 0_u8,
17907 tx_session_pending: 0_u8,
17908 rx_session_pending: 0_u8,
17909 };
17910 #[cfg(feature = "arbitrary")]
17911 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17912 use arbitrary::{Arbitrary, Unstructured};
17913 let mut buf = [0u8; 1024];
17914 rng.fill_bytes(&mut buf);
17915 let mut unstructured = Unstructured::new(&buf);
17916 Self::arbitrary(&mut unstructured).unwrap_or_default()
17917 }
17918}
17919impl Default for ISBD_LINK_STATUS_DATA {
17920 fn default() -> Self {
17921 Self::DEFAULT.clone()
17922 }
17923}
17924impl MessageData for ISBD_LINK_STATUS_DATA {
17925 type Message = MavMessage;
17926 const ID: u32 = 335u32;
17927 const NAME: &'static str = "ISBD_LINK_STATUS";
17928 const EXTRA_CRC: u8 = 225u8;
17929 const ENCODED_LEN: usize = 24usize;
17930 fn deser(
17931 _version: MavlinkVersion,
17932 __input: &[u8],
17933 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17934 let avail_len = __input.len();
17935 let mut payload_buf = [0; Self::ENCODED_LEN];
17936 let mut buf = if avail_len < Self::ENCODED_LEN {
17937 payload_buf[0..avail_len].copy_from_slice(__input);
17938 Bytes::new(&payload_buf)
17939 } else {
17940 Bytes::new(__input)
17941 };
17942 let mut __struct = Self::default();
17943 __struct.timestamp = buf.get_u64_le()?;
17944 __struct.last_heartbeat = buf.get_u64_le()?;
17945 __struct.failed_sessions = buf.get_u16_le()?;
17946 __struct.successful_sessions = buf.get_u16_le()?;
17947 __struct.signal_quality = buf.get_u8()?;
17948 __struct.ring_pending = buf.get_u8()?;
17949 __struct.tx_session_pending = buf.get_u8()?;
17950 __struct.rx_session_pending = buf.get_u8()?;
17951 Ok(__struct)
17952 }
17953 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17954 let mut __tmp = BytesMut::new(bytes);
17955 #[allow(clippy::absurd_extreme_comparisons)]
17956 #[allow(unused_comparisons)]
17957 if __tmp.remaining() < Self::ENCODED_LEN {
17958 panic!(
17959 "buffer is too small (need {} bytes, but got {})",
17960 Self::ENCODED_LEN,
17961 __tmp.remaining(),
17962 )
17963 }
17964 __tmp.put_u64_le(self.timestamp);
17965 __tmp.put_u64_le(self.last_heartbeat);
17966 __tmp.put_u16_le(self.failed_sessions);
17967 __tmp.put_u16_le(self.successful_sessions);
17968 __tmp.put_u8(self.signal_quality);
17969 __tmp.put_u8(self.ring_pending);
17970 __tmp.put_u8(self.tx_session_pending);
17971 __tmp.put_u8(self.rx_session_pending);
17972 if matches!(version, MavlinkVersion::V2) {
17973 let len = __tmp.len();
17974 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17975 } else {
17976 __tmp.len()
17977 }
17978 }
17979}
17980#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
17981#[doc = ""]
17982#[doc = "ID: 149"]
17983#[derive(Debug, Clone, PartialEq)]
17984#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17985#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17986#[cfg_attr(feature = "ts", derive(TS))]
17987#[cfg_attr(feature = "ts", ts(export))]
17988pub struct LANDING_TARGET_DATA {
17989 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17990 pub time_usec: u64,
17991 #[doc = "X-axis angular offset of the target from the center of the image"]
17992 pub angle_x: f32,
17993 #[doc = "Y-axis angular offset of the target from the center of the image"]
17994 pub angle_y: f32,
17995 #[doc = "Distance to the target from the vehicle"]
17996 pub distance: f32,
17997 #[doc = "Size of target along x-axis"]
17998 pub size_x: f32,
17999 #[doc = "Size of target along y-axis"]
18000 pub size_y: f32,
18001 #[doc = "The ID of the target if multiple targets are present"]
18002 pub target_num: u8,
18003 #[doc = "Coordinate frame used for following fields."]
18004 pub frame: MavFrame,
18005 #[doc = "X Position of the landing target in MAV_FRAME"]
18006 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18007 pub x: f32,
18008 #[doc = "Y Position of the landing target in MAV_FRAME"]
18009 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18010 pub y: f32,
18011 #[doc = "Z Position of the landing target in MAV_FRAME"]
18012 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18013 pub z: f32,
18014 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
18015 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18016 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18017 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18018 pub q: [f32; 4],
18019 #[doc = "Type of landing target"]
18020 #[cfg_attr(feature = "serde", serde(default))]
18021 pub mavtype: LandingTargetType,
18022 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
18023 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18024 pub position_valid: u8,
18025}
18026impl LANDING_TARGET_DATA {
18027 pub const ENCODED_LEN: usize = 60usize;
18028 pub const DEFAULT: Self = Self {
18029 time_usec: 0_u64,
18030 angle_x: 0.0_f32,
18031 angle_y: 0.0_f32,
18032 distance: 0.0_f32,
18033 size_x: 0.0_f32,
18034 size_y: 0.0_f32,
18035 target_num: 0_u8,
18036 frame: MavFrame::DEFAULT,
18037 x: 0.0_f32,
18038 y: 0.0_f32,
18039 z: 0.0_f32,
18040 q: [0.0_f32; 4usize],
18041 mavtype: LandingTargetType::DEFAULT,
18042 position_valid: 0_u8,
18043 };
18044 #[cfg(feature = "arbitrary")]
18045 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18046 use arbitrary::{Arbitrary, Unstructured};
18047 let mut buf = [0u8; 1024];
18048 rng.fill_bytes(&mut buf);
18049 let mut unstructured = Unstructured::new(&buf);
18050 Self::arbitrary(&mut unstructured).unwrap_or_default()
18051 }
18052}
18053impl Default for LANDING_TARGET_DATA {
18054 fn default() -> Self {
18055 Self::DEFAULT.clone()
18056 }
18057}
18058impl MessageData for LANDING_TARGET_DATA {
18059 type Message = MavMessage;
18060 const ID: u32 = 149u32;
18061 const NAME: &'static str = "LANDING_TARGET";
18062 const EXTRA_CRC: u8 = 200u8;
18063 const ENCODED_LEN: usize = 60usize;
18064 fn deser(
18065 _version: MavlinkVersion,
18066 __input: &[u8],
18067 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18068 let avail_len = __input.len();
18069 let mut payload_buf = [0; Self::ENCODED_LEN];
18070 let mut buf = if avail_len < Self::ENCODED_LEN {
18071 payload_buf[0..avail_len].copy_from_slice(__input);
18072 Bytes::new(&payload_buf)
18073 } else {
18074 Bytes::new(__input)
18075 };
18076 let mut __struct = Self::default();
18077 __struct.time_usec = buf.get_u64_le()?;
18078 __struct.angle_x = buf.get_f32_le()?;
18079 __struct.angle_y = buf.get_f32_le()?;
18080 __struct.distance = buf.get_f32_le()?;
18081 __struct.size_x = buf.get_f32_le()?;
18082 __struct.size_y = buf.get_f32_le()?;
18083 __struct.target_num = buf.get_u8()?;
18084 let tmp = buf.get_u8()?;
18085 __struct.frame =
18086 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18087 enum_type: "MavFrame",
18088 value: tmp as u64,
18089 })?;
18090 __struct.x = buf.get_f32_le()?;
18091 __struct.y = buf.get_f32_le()?;
18092 __struct.z = buf.get_f32_le()?;
18093 for v in &mut __struct.q {
18094 let val = buf.get_f32_le()?;
18095 *v = val;
18096 }
18097 let tmp = buf.get_u8()?;
18098 __struct.mavtype =
18099 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18100 enum_type: "LandingTargetType",
18101 value: tmp as u64,
18102 })?;
18103 __struct.position_valid = buf.get_u8()?;
18104 Ok(__struct)
18105 }
18106 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18107 let mut __tmp = BytesMut::new(bytes);
18108 #[allow(clippy::absurd_extreme_comparisons)]
18109 #[allow(unused_comparisons)]
18110 if __tmp.remaining() < Self::ENCODED_LEN {
18111 panic!(
18112 "buffer is too small (need {} bytes, but got {})",
18113 Self::ENCODED_LEN,
18114 __tmp.remaining(),
18115 )
18116 }
18117 __tmp.put_u64_le(self.time_usec);
18118 __tmp.put_f32_le(self.angle_x);
18119 __tmp.put_f32_le(self.angle_y);
18120 __tmp.put_f32_le(self.distance);
18121 __tmp.put_f32_le(self.size_x);
18122 __tmp.put_f32_le(self.size_y);
18123 __tmp.put_u8(self.target_num);
18124 __tmp.put_u8(self.frame as u8);
18125 if matches!(version, MavlinkVersion::V2) {
18126 __tmp.put_f32_le(self.x);
18127 __tmp.put_f32_le(self.y);
18128 __tmp.put_f32_le(self.z);
18129 for val in &self.q {
18130 __tmp.put_f32_le(*val);
18131 }
18132 __tmp.put_u8(self.mavtype as u8);
18133 __tmp.put_u8(self.position_valid);
18134 let len = __tmp.len();
18135 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18136 } else {
18137 __tmp.len()
18138 }
18139 }
18140}
18141#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
18142#[doc = ""]
18143#[doc = "ID: 8"]
18144#[derive(Debug, Clone, PartialEq)]
18145#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18146#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18147#[cfg_attr(feature = "ts", derive(TS))]
18148#[cfg_attr(feature = "ts", ts(export))]
18149pub struct LINK_NODE_STATUS_DATA {
18150 #[doc = "Timestamp (time since system boot)."]
18151 pub timestamp: u64,
18152 #[doc = "Transmit rate"]
18153 pub tx_rate: u32,
18154 #[doc = "Receive rate"]
18155 pub rx_rate: u32,
18156 #[doc = "Messages sent"]
18157 pub messages_sent: u32,
18158 #[doc = "Messages received (estimated from counting seq)"]
18159 pub messages_received: u32,
18160 #[doc = "Messages lost (estimated from counting seq)"]
18161 pub messages_lost: u32,
18162 #[doc = "Number of bytes that could not be parsed correctly."]
18163 pub rx_parse_err: u16,
18164 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
18165 pub tx_overflows: u16,
18166 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
18167 pub rx_overflows: u16,
18168 #[doc = "Remaining free transmit buffer space"]
18169 pub tx_buf: u8,
18170 #[doc = "Remaining free receive buffer space"]
18171 pub rx_buf: u8,
18172}
18173impl LINK_NODE_STATUS_DATA {
18174 pub const ENCODED_LEN: usize = 36usize;
18175 pub const DEFAULT: Self = Self {
18176 timestamp: 0_u64,
18177 tx_rate: 0_u32,
18178 rx_rate: 0_u32,
18179 messages_sent: 0_u32,
18180 messages_received: 0_u32,
18181 messages_lost: 0_u32,
18182 rx_parse_err: 0_u16,
18183 tx_overflows: 0_u16,
18184 rx_overflows: 0_u16,
18185 tx_buf: 0_u8,
18186 rx_buf: 0_u8,
18187 };
18188 #[cfg(feature = "arbitrary")]
18189 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18190 use arbitrary::{Arbitrary, Unstructured};
18191 let mut buf = [0u8; 1024];
18192 rng.fill_bytes(&mut buf);
18193 let mut unstructured = Unstructured::new(&buf);
18194 Self::arbitrary(&mut unstructured).unwrap_or_default()
18195 }
18196}
18197impl Default for LINK_NODE_STATUS_DATA {
18198 fn default() -> Self {
18199 Self::DEFAULT.clone()
18200 }
18201}
18202impl MessageData for LINK_NODE_STATUS_DATA {
18203 type Message = MavMessage;
18204 const ID: u32 = 8u32;
18205 const NAME: &'static str = "LINK_NODE_STATUS";
18206 const EXTRA_CRC: u8 = 117u8;
18207 const ENCODED_LEN: usize = 36usize;
18208 fn deser(
18209 _version: MavlinkVersion,
18210 __input: &[u8],
18211 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18212 let avail_len = __input.len();
18213 let mut payload_buf = [0; Self::ENCODED_LEN];
18214 let mut buf = if avail_len < Self::ENCODED_LEN {
18215 payload_buf[0..avail_len].copy_from_slice(__input);
18216 Bytes::new(&payload_buf)
18217 } else {
18218 Bytes::new(__input)
18219 };
18220 let mut __struct = Self::default();
18221 __struct.timestamp = buf.get_u64_le()?;
18222 __struct.tx_rate = buf.get_u32_le()?;
18223 __struct.rx_rate = buf.get_u32_le()?;
18224 __struct.messages_sent = buf.get_u32_le()?;
18225 __struct.messages_received = buf.get_u32_le()?;
18226 __struct.messages_lost = buf.get_u32_le()?;
18227 __struct.rx_parse_err = buf.get_u16_le()?;
18228 __struct.tx_overflows = buf.get_u16_le()?;
18229 __struct.rx_overflows = buf.get_u16_le()?;
18230 __struct.tx_buf = buf.get_u8()?;
18231 __struct.rx_buf = buf.get_u8()?;
18232 Ok(__struct)
18233 }
18234 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18235 let mut __tmp = BytesMut::new(bytes);
18236 #[allow(clippy::absurd_extreme_comparisons)]
18237 #[allow(unused_comparisons)]
18238 if __tmp.remaining() < Self::ENCODED_LEN {
18239 panic!(
18240 "buffer is too small (need {} bytes, but got {})",
18241 Self::ENCODED_LEN,
18242 __tmp.remaining(),
18243 )
18244 }
18245 __tmp.put_u64_le(self.timestamp);
18246 __tmp.put_u32_le(self.tx_rate);
18247 __tmp.put_u32_le(self.rx_rate);
18248 __tmp.put_u32_le(self.messages_sent);
18249 __tmp.put_u32_le(self.messages_received);
18250 __tmp.put_u32_le(self.messages_lost);
18251 __tmp.put_u16_le(self.rx_parse_err);
18252 __tmp.put_u16_le(self.tx_overflows);
18253 __tmp.put_u16_le(self.rx_overflows);
18254 __tmp.put_u8(self.tx_buf);
18255 __tmp.put_u8(self.rx_buf);
18256 if matches!(version, MavlinkVersion::V2) {
18257 let len = __tmp.len();
18258 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18259 } else {
18260 __tmp.len()
18261 }
18262 }
18263}
18264#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18265#[doc = ""]
18266#[doc = "ID: 32"]
18267#[derive(Debug, Clone, PartialEq)]
18268#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18269#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18270#[cfg_attr(feature = "ts", derive(TS))]
18271#[cfg_attr(feature = "ts", ts(export))]
18272pub struct LOCAL_POSITION_NED_DATA {
18273 #[doc = "Timestamp (time since system boot)."]
18274 pub time_boot_ms: u32,
18275 #[doc = "X Position"]
18276 pub x: f32,
18277 #[doc = "Y Position"]
18278 pub y: f32,
18279 #[doc = "Z Position"]
18280 pub z: f32,
18281 #[doc = "X Speed"]
18282 pub vx: f32,
18283 #[doc = "Y Speed"]
18284 pub vy: f32,
18285 #[doc = "Z Speed"]
18286 pub vz: f32,
18287}
18288impl LOCAL_POSITION_NED_DATA {
18289 pub const ENCODED_LEN: usize = 28usize;
18290 pub const DEFAULT: Self = Self {
18291 time_boot_ms: 0_u32,
18292 x: 0.0_f32,
18293 y: 0.0_f32,
18294 z: 0.0_f32,
18295 vx: 0.0_f32,
18296 vy: 0.0_f32,
18297 vz: 0.0_f32,
18298 };
18299 #[cfg(feature = "arbitrary")]
18300 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18301 use arbitrary::{Arbitrary, Unstructured};
18302 let mut buf = [0u8; 1024];
18303 rng.fill_bytes(&mut buf);
18304 let mut unstructured = Unstructured::new(&buf);
18305 Self::arbitrary(&mut unstructured).unwrap_or_default()
18306 }
18307}
18308impl Default for LOCAL_POSITION_NED_DATA {
18309 fn default() -> Self {
18310 Self::DEFAULT.clone()
18311 }
18312}
18313impl MessageData for LOCAL_POSITION_NED_DATA {
18314 type Message = MavMessage;
18315 const ID: u32 = 32u32;
18316 const NAME: &'static str = "LOCAL_POSITION_NED";
18317 const EXTRA_CRC: u8 = 185u8;
18318 const ENCODED_LEN: usize = 28usize;
18319 fn deser(
18320 _version: MavlinkVersion,
18321 __input: &[u8],
18322 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18323 let avail_len = __input.len();
18324 let mut payload_buf = [0; Self::ENCODED_LEN];
18325 let mut buf = if avail_len < Self::ENCODED_LEN {
18326 payload_buf[0..avail_len].copy_from_slice(__input);
18327 Bytes::new(&payload_buf)
18328 } else {
18329 Bytes::new(__input)
18330 };
18331 let mut __struct = Self::default();
18332 __struct.time_boot_ms = buf.get_u32_le()?;
18333 __struct.x = buf.get_f32_le()?;
18334 __struct.y = buf.get_f32_le()?;
18335 __struct.z = buf.get_f32_le()?;
18336 __struct.vx = buf.get_f32_le()?;
18337 __struct.vy = buf.get_f32_le()?;
18338 __struct.vz = buf.get_f32_le()?;
18339 Ok(__struct)
18340 }
18341 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18342 let mut __tmp = BytesMut::new(bytes);
18343 #[allow(clippy::absurd_extreme_comparisons)]
18344 #[allow(unused_comparisons)]
18345 if __tmp.remaining() < Self::ENCODED_LEN {
18346 panic!(
18347 "buffer is too small (need {} bytes, but got {})",
18348 Self::ENCODED_LEN,
18349 __tmp.remaining(),
18350 )
18351 }
18352 __tmp.put_u32_le(self.time_boot_ms);
18353 __tmp.put_f32_le(self.x);
18354 __tmp.put_f32_le(self.y);
18355 __tmp.put_f32_le(self.z);
18356 __tmp.put_f32_le(self.vx);
18357 __tmp.put_f32_le(self.vy);
18358 __tmp.put_f32_le(self.vz);
18359 if matches!(version, MavlinkVersion::V2) {
18360 let len = __tmp.len();
18361 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18362 } else {
18363 __tmp.len()
18364 }
18365 }
18366}
18367#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18368#[doc = ""]
18369#[doc = "ID: 64"]
18370#[derive(Debug, Clone, PartialEq)]
18371#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18372#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18373#[cfg_attr(feature = "ts", derive(TS))]
18374#[cfg_attr(feature = "ts", ts(export))]
18375pub struct LOCAL_POSITION_NED_COV_DATA {
18376 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18377 pub time_usec: u64,
18378 #[doc = "X Position"]
18379 pub x: f32,
18380 #[doc = "Y Position"]
18381 pub y: f32,
18382 #[doc = "Z Position"]
18383 pub z: f32,
18384 #[doc = "X Speed"]
18385 pub vx: f32,
18386 #[doc = "Y Speed"]
18387 pub vy: f32,
18388 #[doc = "Z Speed"]
18389 pub vz: f32,
18390 #[doc = "X Acceleration"]
18391 pub ax: f32,
18392 #[doc = "Y Acceleration"]
18393 pub ay: f32,
18394 #[doc = "Z Acceleration"]
18395 pub az: f32,
18396 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
18397 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18398 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18399 pub covariance: [f32; 45],
18400 #[doc = "Class id of the estimator this estimate originated from."]
18401 pub estimator_type: MavEstimatorType,
18402}
18403impl LOCAL_POSITION_NED_COV_DATA {
18404 pub const ENCODED_LEN: usize = 225usize;
18405 pub const DEFAULT: Self = Self {
18406 time_usec: 0_u64,
18407 x: 0.0_f32,
18408 y: 0.0_f32,
18409 z: 0.0_f32,
18410 vx: 0.0_f32,
18411 vy: 0.0_f32,
18412 vz: 0.0_f32,
18413 ax: 0.0_f32,
18414 ay: 0.0_f32,
18415 az: 0.0_f32,
18416 covariance: [0.0_f32; 45usize],
18417 estimator_type: MavEstimatorType::DEFAULT,
18418 };
18419 #[cfg(feature = "arbitrary")]
18420 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18421 use arbitrary::{Arbitrary, Unstructured};
18422 let mut buf = [0u8; 1024];
18423 rng.fill_bytes(&mut buf);
18424 let mut unstructured = Unstructured::new(&buf);
18425 Self::arbitrary(&mut unstructured).unwrap_or_default()
18426 }
18427}
18428impl Default for LOCAL_POSITION_NED_COV_DATA {
18429 fn default() -> Self {
18430 Self::DEFAULT.clone()
18431 }
18432}
18433impl MessageData for LOCAL_POSITION_NED_COV_DATA {
18434 type Message = MavMessage;
18435 const ID: u32 = 64u32;
18436 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
18437 const EXTRA_CRC: u8 = 191u8;
18438 const ENCODED_LEN: usize = 225usize;
18439 fn deser(
18440 _version: MavlinkVersion,
18441 __input: &[u8],
18442 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18443 let avail_len = __input.len();
18444 let mut payload_buf = [0; Self::ENCODED_LEN];
18445 let mut buf = if avail_len < Self::ENCODED_LEN {
18446 payload_buf[0..avail_len].copy_from_slice(__input);
18447 Bytes::new(&payload_buf)
18448 } else {
18449 Bytes::new(__input)
18450 };
18451 let mut __struct = Self::default();
18452 __struct.time_usec = buf.get_u64_le()?;
18453 __struct.x = buf.get_f32_le()?;
18454 __struct.y = buf.get_f32_le()?;
18455 __struct.z = buf.get_f32_le()?;
18456 __struct.vx = buf.get_f32_le()?;
18457 __struct.vy = buf.get_f32_le()?;
18458 __struct.vz = buf.get_f32_le()?;
18459 __struct.ax = buf.get_f32_le()?;
18460 __struct.ay = buf.get_f32_le()?;
18461 __struct.az = buf.get_f32_le()?;
18462 for v in &mut __struct.covariance {
18463 let val = buf.get_f32_le()?;
18464 *v = val;
18465 }
18466 let tmp = buf.get_u8()?;
18467 __struct.estimator_type =
18468 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18469 enum_type: "MavEstimatorType",
18470 value: tmp as u64,
18471 })?;
18472 Ok(__struct)
18473 }
18474 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18475 let mut __tmp = BytesMut::new(bytes);
18476 #[allow(clippy::absurd_extreme_comparisons)]
18477 #[allow(unused_comparisons)]
18478 if __tmp.remaining() < Self::ENCODED_LEN {
18479 panic!(
18480 "buffer is too small (need {} bytes, but got {})",
18481 Self::ENCODED_LEN,
18482 __tmp.remaining(),
18483 )
18484 }
18485 __tmp.put_u64_le(self.time_usec);
18486 __tmp.put_f32_le(self.x);
18487 __tmp.put_f32_le(self.y);
18488 __tmp.put_f32_le(self.z);
18489 __tmp.put_f32_le(self.vx);
18490 __tmp.put_f32_le(self.vy);
18491 __tmp.put_f32_le(self.vz);
18492 __tmp.put_f32_le(self.ax);
18493 __tmp.put_f32_le(self.ay);
18494 __tmp.put_f32_le(self.az);
18495 for val in &self.covariance {
18496 __tmp.put_f32_le(*val);
18497 }
18498 __tmp.put_u8(self.estimator_type as u8);
18499 if matches!(version, MavlinkVersion::V2) {
18500 let len = __tmp.len();
18501 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18502 } else {
18503 __tmp.len()
18504 }
18505 }
18506}
18507#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
18508#[doc = ""]
18509#[doc = "ID: 89"]
18510#[derive(Debug, Clone, PartialEq)]
18511#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18512#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18513#[cfg_attr(feature = "ts", derive(TS))]
18514#[cfg_attr(feature = "ts", ts(export))]
18515pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18516 #[doc = "Timestamp (time since system boot)."]
18517 pub time_boot_ms: u32,
18518 #[doc = "X Position"]
18519 pub x: f32,
18520 #[doc = "Y Position"]
18521 pub y: f32,
18522 #[doc = "Z Position"]
18523 pub z: f32,
18524 #[doc = "Roll"]
18525 pub roll: f32,
18526 #[doc = "Pitch"]
18527 pub pitch: f32,
18528 #[doc = "Yaw"]
18529 pub yaw: f32,
18530}
18531impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18532 pub const ENCODED_LEN: usize = 28usize;
18533 pub const DEFAULT: Self = Self {
18534 time_boot_ms: 0_u32,
18535 x: 0.0_f32,
18536 y: 0.0_f32,
18537 z: 0.0_f32,
18538 roll: 0.0_f32,
18539 pitch: 0.0_f32,
18540 yaw: 0.0_f32,
18541 };
18542 #[cfg(feature = "arbitrary")]
18543 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18544 use arbitrary::{Arbitrary, Unstructured};
18545 let mut buf = [0u8; 1024];
18546 rng.fill_bytes(&mut buf);
18547 let mut unstructured = Unstructured::new(&buf);
18548 Self::arbitrary(&mut unstructured).unwrap_or_default()
18549 }
18550}
18551impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18552 fn default() -> Self {
18553 Self::DEFAULT.clone()
18554 }
18555}
18556impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
18557 type Message = MavMessage;
18558 const ID: u32 = 89u32;
18559 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
18560 const EXTRA_CRC: u8 = 231u8;
18561 const ENCODED_LEN: usize = 28usize;
18562 fn deser(
18563 _version: MavlinkVersion,
18564 __input: &[u8],
18565 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18566 let avail_len = __input.len();
18567 let mut payload_buf = [0; Self::ENCODED_LEN];
18568 let mut buf = if avail_len < Self::ENCODED_LEN {
18569 payload_buf[0..avail_len].copy_from_slice(__input);
18570 Bytes::new(&payload_buf)
18571 } else {
18572 Bytes::new(__input)
18573 };
18574 let mut __struct = Self::default();
18575 __struct.time_boot_ms = buf.get_u32_le()?;
18576 __struct.x = buf.get_f32_le()?;
18577 __struct.y = buf.get_f32_le()?;
18578 __struct.z = buf.get_f32_le()?;
18579 __struct.roll = buf.get_f32_le()?;
18580 __struct.pitch = buf.get_f32_le()?;
18581 __struct.yaw = buf.get_f32_le()?;
18582 Ok(__struct)
18583 }
18584 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18585 let mut __tmp = BytesMut::new(bytes);
18586 #[allow(clippy::absurd_extreme_comparisons)]
18587 #[allow(unused_comparisons)]
18588 if __tmp.remaining() < Self::ENCODED_LEN {
18589 panic!(
18590 "buffer is too small (need {} bytes, but got {})",
18591 Self::ENCODED_LEN,
18592 __tmp.remaining(),
18593 )
18594 }
18595 __tmp.put_u32_le(self.time_boot_ms);
18596 __tmp.put_f32_le(self.x);
18597 __tmp.put_f32_le(self.y);
18598 __tmp.put_f32_le(self.z);
18599 __tmp.put_f32_le(self.roll);
18600 __tmp.put_f32_le(self.pitch);
18601 __tmp.put_f32_le(self.yaw);
18602 if matches!(version, MavlinkVersion::V2) {
18603 let len = __tmp.len();
18604 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18605 } else {
18606 __tmp.len()
18607 }
18608 }
18609}
18610#[doc = "An ack for a LOGGING_DATA_ACKED message."]
18611#[doc = ""]
18612#[doc = "ID: 268"]
18613#[derive(Debug, Clone, PartialEq)]
18614#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18615#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18616#[cfg_attr(feature = "ts", derive(TS))]
18617#[cfg_attr(feature = "ts", ts(export))]
18618pub struct LOGGING_ACK_DATA {
18619 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
18620 pub sequence: u16,
18621 #[doc = "system ID of the target"]
18622 pub target_system: u8,
18623 #[doc = "component ID of the target"]
18624 pub target_component: u8,
18625}
18626impl LOGGING_ACK_DATA {
18627 pub const ENCODED_LEN: usize = 4usize;
18628 pub const DEFAULT: Self = Self {
18629 sequence: 0_u16,
18630 target_system: 0_u8,
18631 target_component: 0_u8,
18632 };
18633 #[cfg(feature = "arbitrary")]
18634 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18635 use arbitrary::{Arbitrary, Unstructured};
18636 let mut buf = [0u8; 1024];
18637 rng.fill_bytes(&mut buf);
18638 let mut unstructured = Unstructured::new(&buf);
18639 Self::arbitrary(&mut unstructured).unwrap_or_default()
18640 }
18641}
18642impl Default for LOGGING_ACK_DATA {
18643 fn default() -> Self {
18644 Self::DEFAULT.clone()
18645 }
18646}
18647impl MessageData for LOGGING_ACK_DATA {
18648 type Message = MavMessage;
18649 const ID: u32 = 268u32;
18650 const NAME: &'static str = "LOGGING_ACK";
18651 const EXTRA_CRC: u8 = 14u8;
18652 const ENCODED_LEN: usize = 4usize;
18653 fn deser(
18654 _version: MavlinkVersion,
18655 __input: &[u8],
18656 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18657 let avail_len = __input.len();
18658 let mut payload_buf = [0; Self::ENCODED_LEN];
18659 let mut buf = if avail_len < Self::ENCODED_LEN {
18660 payload_buf[0..avail_len].copy_from_slice(__input);
18661 Bytes::new(&payload_buf)
18662 } else {
18663 Bytes::new(__input)
18664 };
18665 let mut __struct = Self::default();
18666 __struct.sequence = buf.get_u16_le()?;
18667 __struct.target_system = buf.get_u8()?;
18668 __struct.target_component = buf.get_u8()?;
18669 Ok(__struct)
18670 }
18671 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18672 let mut __tmp = BytesMut::new(bytes);
18673 #[allow(clippy::absurd_extreme_comparisons)]
18674 #[allow(unused_comparisons)]
18675 if __tmp.remaining() < Self::ENCODED_LEN {
18676 panic!(
18677 "buffer is too small (need {} bytes, but got {})",
18678 Self::ENCODED_LEN,
18679 __tmp.remaining(),
18680 )
18681 }
18682 __tmp.put_u16_le(self.sequence);
18683 __tmp.put_u8(self.target_system);
18684 __tmp.put_u8(self.target_component);
18685 if matches!(version, MavlinkVersion::V2) {
18686 let len = __tmp.len();
18687 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18688 } else {
18689 __tmp.len()
18690 }
18691 }
18692}
18693#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
18694#[doc = ""]
18695#[doc = "ID: 266"]
18696#[derive(Debug, Clone, PartialEq)]
18697#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18698#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18699#[cfg_attr(feature = "ts", derive(TS))]
18700#[cfg_attr(feature = "ts", ts(export))]
18701pub struct LOGGING_DATA_DATA {
18702 #[doc = "sequence number (can wrap)"]
18703 pub sequence: u16,
18704 #[doc = "system ID of the target"]
18705 pub target_system: u8,
18706 #[doc = "component ID of the target"]
18707 pub target_component: u8,
18708 #[doc = "data length"]
18709 pub length: u8,
18710 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18711 pub first_message_offset: u8,
18712 #[doc = "logged data"]
18713 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18714 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18715 pub data: [u8; 249],
18716}
18717impl LOGGING_DATA_DATA {
18718 pub const ENCODED_LEN: usize = 255usize;
18719 pub const DEFAULT: Self = Self {
18720 sequence: 0_u16,
18721 target_system: 0_u8,
18722 target_component: 0_u8,
18723 length: 0_u8,
18724 first_message_offset: 0_u8,
18725 data: [0_u8; 249usize],
18726 };
18727 #[cfg(feature = "arbitrary")]
18728 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18729 use arbitrary::{Arbitrary, Unstructured};
18730 let mut buf = [0u8; 1024];
18731 rng.fill_bytes(&mut buf);
18732 let mut unstructured = Unstructured::new(&buf);
18733 Self::arbitrary(&mut unstructured).unwrap_or_default()
18734 }
18735}
18736impl Default for LOGGING_DATA_DATA {
18737 fn default() -> Self {
18738 Self::DEFAULT.clone()
18739 }
18740}
18741impl MessageData for LOGGING_DATA_DATA {
18742 type Message = MavMessage;
18743 const ID: u32 = 266u32;
18744 const NAME: &'static str = "LOGGING_DATA";
18745 const EXTRA_CRC: u8 = 193u8;
18746 const ENCODED_LEN: usize = 255usize;
18747 fn deser(
18748 _version: MavlinkVersion,
18749 __input: &[u8],
18750 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18751 let avail_len = __input.len();
18752 let mut payload_buf = [0; Self::ENCODED_LEN];
18753 let mut buf = if avail_len < Self::ENCODED_LEN {
18754 payload_buf[0..avail_len].copy_from_slice(__input);
18755 Bytes::new(&payload_buf)
18756 } else {
18757 Bytes::new(__input)
18758 };
18759 let mut __struct = Self::default();
18760 __struct.sequence = buf.get_u16_le()?;
18761 __struct.target_system = buf.get_u8()?;
18762 __struct.target_component = buf.get_u8()?;
18763 __struct.length = buf.get_u8()?;
18764 __struct.first_message_offset = buf.get_u8()?;
18765 for v in &mut __struct.data {
18766 let val = buf.get_u8()?;
18767 *v = val;
18768 }
18769 Ok(__struct)
18770 }
18771 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18772 let mut __tmp = BytesMut::new(bytes);
18773 #[allow(clippy::absurd_extreme_comparisons)]
18774 #[allow(unused_comparisons)]
18775 if __tmp.remaining() < Self::ENCODED_LEN {
18776 panic!(
18777 "buffer is too small (need {} bytes, but got {})",
18778 Self::ENCODED_LEN,
18779 __tmp.remaining(),
18780 )
18781 }
18782 __tmp.put_u16_le(self.sequence);
18783 __tmp.put_u8(self.target_system);
18784 __tmp.put_u8(self.target_component);
18785 __tmp.put_u8(self.length);
18786 __tmp.put_u8(self.first_message_offset);
18787 for val in &self.data {
18788 __tmp.put_u8(*val);
18789 }
18790 if matches!(version, MavlinkVersion::V2) {
18791 let len = __tmp.len();
18792 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18793 } else {
18794 __tmp.len()
18795 }
18796 }
18797}
18798#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
18799#[doc = ""]
18800#[doc = "ID: 267"]
18801#[derive(Debug, Clone, PartialEq)]
18802#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18803#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18804#[cfg_attr(feature = "ts", derive(TS))]
18805#[cfg_attr(feature = "ts", ts(export))]
18806pub struct LOGGING_DATA_ACKED_DATA {
18807 #[doc = "sequence number (can wrap)"]
18808 pub sequence: u16,
18809 #[doc = "system ID of the target"]
18810 pub target_system: u8,
18811 #[doc = "component ID of the target"]
18812 pub target_component: u8,
18813 #[doc = "data length"]
18814 pub length: u8,
18815 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
18816 pub first_message_offset: u8,
18817 #[doc = "logged data"]
18818 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18819 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18820 pub data: [u8; 249],
18821}
18822impl LOGGING_DATA_ACKED_DATA {
18823 pub const ENCODED_LEN: usize = 255usize;
18824 pub const DEFAULT: Self = Self {
18825 sequence: 0_u16,
18826 target_system: 0_u8,
18827 target_component: 0_u8,
18828 length: 0_u8,
18829 first_message_offset: 0_u8,
18830 data: [0_u8; 249usize],
18831 };
18832 #[cfg(feature = "arbitrary")]
18833 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18834 use arbitrary::{Arbitrary, Unstructured};
18835 let mut buf = [0u8; 1024];
18836 rng.fill_bytes(&mut buf);
18837 let mut unstructured = Unstructured::new(&buf);
18838 Self::arbitrary(&mut unstructured).unwrap_or_default()
18839 }
18840}
18841impl Default for LOGGING_DATA_ACKED_DATA {
18842 fn default() -> Self {
18843 Self::DEFAULT.clone()
18844 }
18845}
18846impl MessageData for LOGGING_DATA_ACKED_DATA {
18847 type Message = MavMessage;
18848 const ID: u32 = 267u32;
18849 const NAME: &'static str = "LOGGING_DATA_ACKED";
18850 const EXTRA_CRC: u8 = 35u8;
18851 const ENCODED_LEN: usize = 255usize;
18852 fn deser(
18853 _version: MavlinkVersion,
18854 __input: &[u8],
18855 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18856 let avail_len = __input.len();
18857 let mut payload_buf = [0; Self::ENCODED_LEN];
18858 let mut buf = if avail_len < Self::ENCODED_LEN {
18859 payload_buf[0..avail_len].copy_from_slice(__input);
18860 Bytes::new(&payload_buf)
18861 } else {
18862 Bytes::new(__input)
18863 };
18864 let mut __struct = Self::default();
18865 __struct.sequence = buf.get_u16_le()?;
18866 __struct.target_system = buf.get_u8()?;
18867 __struct.target_component = buf.get_u8()?;
18868 __struct.length = buf.get_u8()?;
18869 __struct.first_message_offset = buf.get_u8()?;
18870 for v in &mut __struct.data {
18871 let val = buf.get_u8()?;
18872 *v = val;
18873 }
18874 Ok(__struct)
18875 }
18876 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18877 let mut __tmp = BytesMut::new(bytes);
18878 #[allow(clippy::absurd_extreme_comparisons)]
18879 #[allow(unused_comparisons)]
18880 if __tmp.remaining() < Self::ENCODED_LEN {
18881 panic!(
18882 "buffer is too small (need {} bytes, but got {})",
18883 Self::ENCODED_LEN,
18884 __tmp.remaining(),
18885 )
18886 }
18887 __tmp.put_u16_le(self.sequence);
18888 __tmp.put_u8(self.target_system);
18889 __tmp.put_u8(self.target_component);
18890 __tmp.put_u8(self.length);
18891 __tmp.put_u8(self.first_message_offset);
18892 for val in &self.data {
18893 __tmp.put_u8(*val);
18894 }
18895 if matches!(version, MavlinkVersion::V2) {
18896 let len = __tmp.len();
18897 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18898 } else {
18899 __tmp.len()
18900 }
18901 }
18902}
18903#[doc = "Reply to LOG_REQUEST_DATA."]
18904#[doc = ""]
18905#[doc = "ID: 120"]
18906#[derive(Debug, Clone, PartialEq)]
18907#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18908#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18909#[cfg_attr(feature = "ts", derive(TS))]
18910#[cfg_attr(feature = "ts", ts(export))]
18911pub struct LOG_DATA_DATA {
18912 #[doc = "Offset into the log"]
18913 pub ofs: u32,
18914 #[doc = "Log id (from LOG_ENTRY reply)"]
18915 pub id: u16,
18916 #[doc = "Number of bytes (zero for end of log)"]
18917 pub count: u8,
18918 #[doc = "log data"]
18919 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18920 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
18921 pub data: [u8; 90],
18922}
18923impl LOG_DATA_DATA {
18924 pub const ENCODED_LEN: usize = 97usize;
18925 pub const DEFAULT: Self = Self {
18926 ofs: 0_u32,
18927 id: 0_u16,
18928 count: 0_u8,
18929 data: [0_u8; 90usize],
18930 };
18931 #[cfg(feature = "arbitrary")]
18932 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18933 use arbitrary::{Arbitrary, Unstructured};
18934 let mut buf = [0u8; 1024];
18935 rng.fill_bytes(&mut buf);
18936 let mut unstructured = Unstructured::new(&buf);
18937 Self::arbitrary(&mut unstructured).unwrap_or_default()
18938 }
18939}
18940impl Default for LOG_DATA_DATA {
18941 fn default() -> Self {
18942 Self::DEFAULT.clone()
18943 }
18944}
18945impl MessageData for LOG_DATA_DATA {
18946 type Message = MavMessage;
18947 const ID: u32 = 120u32;
18948 const NAME: &'static str = "LOG_DATA";
18949 const EXTRA_CRC: u8 = 134u8;
18950 const ENCODED_LEN: usize = 97usize;
18951 fn deser(
18952 _version: MavlinkVersion,
18953 __input: &[u8],
18954 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18955 let avail_len = __input.len();
18956 let mut payload_buf = [0; Self::ENCODED_LEN];
18957 let mut buf = if avail_len < Self::ENCODED_LEN {
18958 payload_buf[0..avail_len].copy_from_slice(__input);
18959 Bytes::new(&payload_buf)
18960 } else {
18961 Bytes::new(__input)
18962 };
18963 let mut __struct = Self::default();
18964 __struct.ofs = buf.get_u32_le()?;
18965 __struct.id = buf.get_u16_le()?;
18966 __struct.count = buf.get_u8()?;
18967 for v in &mut __struct.data {
18968 let val = buf.get_u8()?;
18969 *v = val;
18970 }
18971 Ok(__struct)
18972 }
18973 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18974 let mut __tmp = BytesMut::new(bytes);
18975 #[allow(clippy::absurd_extreme_comparisons)]
18976 #[allow(unused_comparisons)]
18977 if __tmp.remaining() < Self::ENCODED_LEN {
18978 panic!(
18979 "buffer is too small (need {} bytes, but got {})",
18980 Self::ENCODED_LEN,
18981 __tmp.remaining(),
18982 )
18983 }
18984 __tmp.put_u32_le(self.ofs);
18985 __tmp.put_u16_le(self.id);
18986 __tmp.put_u8(self.count);
18987 for val in &self.data {
18988 __tmp.put_u8(*val);
18989 }
18990 if matches!(version, MavlinkVersion::V2) {
18991 let len = __tmp.len();
18992 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18993 } else {
18994 __tmp.len()
18995 }
18996 }
18997}
18998#[doc = "Reply to LOG_REQUEST_LIST."]
18999#[doc = ""]
19000#[doc = "ID: 118"]
19001#[derive(Debug, Clone, PartialEq)]
19002#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19003#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19004#[cfg_attr(feature = "ts", derive(TS))]
19005#[cfg_attr(feature = "ts", ts(export))]
19006pub struct LOG_ENTRY_DATA {
19007 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
19008 pub time_utc: u32,
19009 #[doc = "Size of the log (may be approximate)"]
19010 pub size: u32,
19011 #[doc = "Log id"]
19012 pub id: u16,
19013 #[doc = "Total number of logs"]
19014 pub num_logs: u16,
19015 #[doc = "High log number"]
19016 pub last_log_num: u16,
19017}
19018impl LOG_ENTRY_DATA {
19019 pub const ENCODED_LEN: usize = 14usize;
19020 pub const DEFAULT: Self = Self {
19021 time_utc: 0_u32,
19022 size: 0_u32,
19023 id: 0_u16,
19024 num_logs: 0_u16,
19025 last_log_num: 0_u16,
19026 };
19027 #[cfg(feature = "arbitrary")]
19028 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19029 use arbitrary::{Arbitrary, Unstructured};
19030 let mut buf = [0u8; 1024];
19031 rng.fill_bytes(&mut buf);
19032 let mut unstructured = Unstructured::new(&buf);
19033 Self::arbitrary(&mut unstructured).unwrap_or_default()
19034 }
19035}
19036impl Default for LOG_ENTRY_DATA {
19037 fn default() -> Self {
19038 Self::DEFAULT.clone()
19039 }
19040}
19041impl MessageData for LOG_ENTRY_DATA {
19042 type Message = MavMessage;
19043 const ID: u32 = 118u32;
19044 const NAME: &'static str = "LOG_ENTRY";
19045 const EXTRA_CRC: u8 = 56u8;
19046 const ENCODED_LEN: usize = 14usize;
19047 fn deser(
19048 _version: MavlinkVersion,
19049 __input: &[u8],
19050 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19051 let avail_len = __input.len();
19052 let mut payload_buf = [0; Self::ENCODED_LEN];
19053 let mut buf = if avail_len < Self::ENCODED_LEN {
19054 payload_buf[0..avail_len].copy_from_slice(__input);
19055 Bytes::new(&payload_buf)
19056 } else {
19057 Bytes::new(__input)
19058 };
19059 let mut __struct = Self::default();
19060 __struct.time_utc = buf.get_u32_le()?;
19061 __struct.size = buf.get_u32_le()?;
19062 __struct.id = buf.get_u16_le()?;
19063 __struct.num_logs = buf.get_u16_le()?;
19064 __struct.last_log_num = buf.get_u16_le()?;
19065 Ok(__struct)
19066 }
19067 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19068 let mut __tmp = BytesMut::new(bytes);
19069 #[allow(clippy::absurd_extreme_comparisons)]
19070 #[allow(unused_comparisons)]
19071 if __tmp.remaining() < Self::ENCODED_LEN {
19072 panic!(
19073 "buffer is too small (need {} bytes, but got {})",
19074 Self::ENCODED_LEN,
19075 __tmp.remaining(),
19076 )
19077 }
19078 __tmp.put_u32_le(self.time_utc);
19079 __tmp.put_u32_le(self.size);
19080 __tmp.put_u16_le(self.id);
19081 __tmp.put_u16_le(self.num_logs);
19082 __tmp.put_u16_le(self.last_log_num);
19083 if matches!(version, MavlinkVersion::V2) {
19084 let len = __tmp.len();
19085 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19086 } else {
19087 __tmp.len()
19088 }
19089 }
19090}
19091#[doc = "Erase all logs."]
19092#[doc = ""]
19093#[doc = "ID: 121"]
19094#[derive(Debug, Clone, PartialEq)]
19095#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19096#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19097#[cfg_attr(feature = "ts", derive(TS))]
19098#[cfg_attr(feature = "ts", ts(export))]
19099pub struct LOG_ERASE_DATA {
19100 #[doc = "System ID"]
19101 pub target_system: u8,
19102 #[doc = "Component ID"]
19103 pub target_component: u8,
19104}
19105impl LOG_ERASE_DATA {
19106 pub const ENCODED_LEN: usize = 2usize;
19107 pub const DEFAULT: Self = Self {
19108 target_system: 0_u8,
19109 target_component: 0_u8,
19110 };
19111 #[cfg(feature = "arbitrary")]
19112 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19113 use arbitrary::{Arbitrary, Unstructured};
19114 let mut buf = [0u8; 1024];
19115 rng.fill_bytes(&mut buf);
19116 let mut unstructured = Unstructured::new(&buf);
19117 Self::arbitrary(&mut unstructured).unwrap_or_default()
19118 }
19119}
19120impl Default for LOG_ERASE_DATA {
19121 fn default() -> Self {
19122 Self::DEFAULT.clone()
19123 }
19124}
19125impl MessageData for LOG_ERASE_DATA {
19126 type Message = MavMessage;
19127 const ID: u32 = 121u32;
19128 const NAME: &'static str = "LOG_ERASE";
19129 const EXTRA_CRC: u8 = 237u8;
19130 const ENCODED_LEN: usize = 2usize;
19131 fn deser(
19132 _version: MavlinkVersion,
19133 __input: &[u8],
19134 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19135 let avail_len = __input.len();
19136 let mut payload_buf = [0; Self::ENCODED_LEN];
19137 let mut buf = if avail_len < Self::ENCODED_LEN {
19138 payload_buf[0..avail_len].copy_from_slice(__input);
19139 Bytes::new(&payload_buf)
19140 } else {
19141 Bytes::new(__input)
19142 };
19143 let mut __struct = Self::default();
19144 __struct.target_system = buf.get_u8()?;
19145 __struct.target_component = buf.get_u8()?;
19146 Ok(__struct)
19147 }
19148 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19149 let mut __tmp = BytesMut::new(bytes);
19150 #[allow(clippy::absurd_extreme_comparisons)]
19151 #[allow(unused_comparisons)]
19152 if __tmp.remaining() < Self::ENCODED_LEN {
19153 panic!(
19154 "buffer is too small (need {} bytes, but got {})",
19155 Self::ENCODED_LEN,
19156 __tmp.remaining(),
19157 )
19158 }
19159 __tmp.put_u8(self.target_system);
19160 __tmp.put_u8(self.target_component);
19161 if matches!(version, MavlinkVersion::V2) {
19162 let len = __tmp.len();
19163 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19164 } else {
19165 __tmp.len()
19166 }
19167 }
19168}
19169#[doc = "Request a chunk of a log."]
19170#[doc = ""]
19171#[doc = "ID: 119"]
19172#[derive(Debug, Clone, PartialEq)]
19173#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19174#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19175#[cfg_attr(feature = "ts", derive(TS))]
19176#[cfg_attr(feature = "ts", ts(export))]
19177pub struct LOG_REQUEST_DATA_DATA {
19178 #[doc = "Offset into the log"]
19179 pub ofs: u32,
19180 #[doc = "Number of bytes"]
19181 pub count: u32,
19182 #[doc = "Log id (from LOG_ENTRY reply)"]
19183 pub id: u16,
19184 #[doc = "System ID"]
19185 pub target_system: u8,
19186 #[doc = "Component ID"]
19187 pub target_component: u8,
19188}
19189impl LOG_REQUEST_DATA_DATA {
19190 pub const ENCODED_LEN: usize = 12usize;
19191 pub const DEFAULT: Self = Self {
19192 ofs: 0_u32,
19193 count: 0_u32,
19194 id: 0_u16,
19195 target_system: 0_u8,
19196 target_component: 0_u8,
19197 };
19198 #[cfg(feature = "arbitrary")]
19199 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19200 use arbitrary::{Arbitrary, Unstructured};
19201 let mut buf = [0u8; 1024];
19202 rng.fill_bytes(&mut buf);
19203 let mut unstructured = Unstructured::new(&buf);
19204 Self::arbitrary(&mut unstructured).unwrap_or_default()
19205 }
19206}
19207impl Default for LOG_REQUEST_DATA_DATA {
19208 fn default() -> Self {
19209 Self::DEFAULT.clone()
19210 }
19211}
19212impl MessageData for LOG_REQUEST_DATA_DATA {
19213 type Message = MavMessage;
19214 const ID: u32 = 119u32;
19215 const NAME: &'static str = "LOG_REQUEST_DATA";
19216 const EXTRA_CRC: u8 = 116u8;
19217 const ENCODED_LEN: usize = 12usize;
19218 fn deser(
19219 _version: MavlinkVersion,
19220 __input: &[u8],
19221 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19222 let avail_len = __input.len();
19223 let mut payload_buf = [0; Self::ENCODED_LEN];
19224 let mut buf = if avail_len < Self::ENCODED_LEN {
19225 payload_buf[0..avail_len].copy_from_slice(__input);
19226 Bytes::new(&payload_buf)
19227 } else {
19228 Bytes::new(__input)
19229 };
19230 let mut __struct = Self::default();
19231 __struct.ofs = buf.get_u32_le()?;
19232 __struct.count = buf.get_u32_le()?;
19233 __struct.id = buf.get_u16_le()?;
19234 __struct.target_system = buf.get_u8()?;
19235 __struct.target_component = buf.get_u8()?;
19236 Ok(__struct)
19237 }
19238 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19239 let mut __tmp = BytesMut::new(bytes);
19240 #[allow(clippy::absurd_extreme_comparisons)]
19241 #[allow(unused_comparisons)]
19242 if __tmp.remaining() < Self::ENCODED_LEN {
19243 panic!(
19244 "buffer is too small (need {} bytes, but got {})",
19245 Self::ENCODED_LEN,
19246 __tmp.remaining(),
19247 )
19248 }
19249 __tmp.put_u32_le(self.ofs);
19250 __tmp.put_u32_le(self.count);
19251 __tmp.put_u16_le(self.id);
19252 __tmp.put_u8(self.target_system);
19253 __tmp.put_u8(self.target_component);
19254 if matches!(version, MavlinkVersion::V2) {
19255 let len = __tmp.len();
19256 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19257 } else {
19258 __tmp.len()
19259 }
19260 }
19261}
19262#[doc = "Stop log transfer and resume normal logging."]
19263#[doc = ""]
19264#[doc = "ID: 122"]
19265#[derive(Debug, Clone, PartialEq)]
19266#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19267#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19268#[cfg_attr(feature = "ts", derive(TS))]
19269#[cfg_attr(feature = "ts", ts(export))]
19270pub struct LOG_REQUEST_END_DATA {
19271 #[doc = "System ID"]
19272 pub target_system: u8,
19273 #[doc = "Component ID"]
19274 pub target_component: u8,
19275}
19276impl LOG_REQUEST_END_DATA {
19277 pub const ENCODED_LEN: usize = 2usize;
19278 pub const DEFAULT: Self = Self {
19279 target_system: 0_u8,
19280 target_component: 0_u8,
19281 };
19282 #[cfg(feature = "arbitrary")]
19283 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19284 use arbitrary::{Arbitrary, Unstructured};
19285 let mut buf = [0u8; 1024];
19286 rng.fill_bytes(&mut buf);
19287 let mut unstructured = Unstructured::new(&buf);
19288 Self::arbitrary(&mut unstructured).unwrap_or_default()
19289 }
19290}
19291impl Default for LOG_REQUEST_END_DATA {
19292 fn default() -> Self {
19293 Self::DEFAULT.clone()
19294 }
19295}
19296impl MessageData for LOG_REQUEST_END_DATA {
19297 type Message = MavMessage;
19298 const ID: u32 = 122u32;
19299 const NAME: &'static str = "LOG_REQUEST_END";
19300 const EXTRA_CRC: u8 = 203u8;
19301 const ENCODED_LEN: usize = 2usize;
19302 fn deser(
19303 _version: MavlinkVersion,
19304 __input: &[u8],
19305 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19306 let avail_len = __input.len();
19307 let mut payload_buf = [0; Self::ENCODED_LEN];
19308 let mut buf = if avail_len < Self::ENCODED_LEN {
19309 payload_buf[0..avail_len].copy_from_slice(__input);
19310 Bytes::new(&payload_buf)
19311 } else {
19312 Bytes::new(__input)
19313 };
19314 let mut __struct = Self::default();
19315 __struct.target_system = buf.get_u8()?;
19316 __struct.target_component = buf.get_u8()?;
19317 Ok(__struct)
19318 }
19319 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19320 let mut __tmp = BytesMut::new(bytes);
19321 #[allow(clippy::absurd_extreme_comparisons)]
19322 #[allow(unused_comparisons)]
19323 if __tmp.remaining() < Self::ENCODED_LEN {
19324 panic!(
19325 "buffer is too small (need {} bytes, but got {})",
19326 Self::ENCODED_LEN,
19327 __tmp.remaining(),
19328 )
19329 }
19330 __tmp.put_u8(self.target_system);
19331 __tmp.put_u8(self.target_component);
19332 if matches!(version, MavlinkVersion::V2) {
19333 let len = __tmp.len();
19334 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19335 } else {
19336 __tmp.len()
19337 }
19338 }
19339}
19340#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
19341#[doc = ""]
19342#[doc = "ID: 117"]
19343#[derive(Debug, Clone, PartialEq)]
19344#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19345#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19346#[cfg_attr(feature = "ts", derive(TS))]
19347#[cfg_attr(feature = "ts", ts(export))]
19348pub struct LOG_REQUEST_LIST_DATA {
19349 #[doc = "First log id (0 for first available)"]
19350 pub start: u16,
19351 #[doc = "Last log id (0xffff for last available)"]
19352 pub end: u16,
19353 #[doc = "System ID"]
19354 pub target_system: u8,
19355 #[doc = "Component ID"]
19356 pub target_component: u8,
19357}
19358impl LOG_REQUEST_LIST_DATA {
19359 pub const ENCODED_LEN: usize = 6usize;
19360 pub const DEFAULT: Self = Self {
19361 start: 0_u16,
19362 end: 0_u16,
19363 target_system: 0_u8,
19364 target_component: 0_u8,
19365 };
19366 #[cfg(feature = "arbitrary")]
19367 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19368 use arbitrary::{Arbitrary, Unstructured};
19369 let mut buf = [0u8; 1024];
19370 rng.fill_bytes(&mut buf);
19371 let mut unstructured = Unstructured::new(&buf);
19372 Self::arbitrary(&mut unstructured).unwrap_or_default()
19373 }
19374}
19375impl Default for LOG_REQUEST_LIST_DATA {
19376 fn default() -> Self {
19377 Self::DEFAULT.clone()
19378 }
19379}
19380impl MessageData for LOG_REQUEST_LIST_DATA {
19381 type Message = MavMessage;
19382 const ID: u32 = 117u32;
19383 const NAME: &'static str = "LOG_REQUEST_LIST";
19384 const EXTRA_CRC: u8 = 128u8;
19385 const ENCODED_LEN: usize = 6usize;
19386 fn deser(
19387 _version: MavlinkVersion,
19388 __input: &[u8],
19389 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19390 let avail_len = __input.len();
19391 let mut payload_buf = [0; Self::ENCODED_LEN];
19392 let mut buf = if avail_len < Self::ENCODED_LEN {
19393 payload_buf[0..avail_len].copy_from_slice(__input);
19394 Bytes::new(&payload_buf)
19395 } else {
19396 Bytes::new(__input)
19397 };
19398 let mut __struct = Self::default();
19399 __struct.start = buf.get_u16_le()?;
19400 __struct.end = buf.get_u16_le()?;
19401 __struct.target_system = buf.get_u8()?;
19402 __struct.target_component = buf.get_u8()?;
19403 Ok(__struct)
19404 }
19405 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19406 let mut __tmp = BytesMut::new(bytes);
19407 #[allow(clippy::absurd_extreme_comparisons)]
19408 #[allow(unused_comparisons)]
19409 if __tmp.remaining() < Self::ENCODED_LEN {
19410 panic!(
19411 "buffer is too small (need {} bytes, but got {})",
19412 Self::ENCODED_LEN,
19413 __tmp.remaining(),
19414 )
19415 }
19416 __tmp.put_u16_le(self.start);
19417 __tmp.put_u16_le(self.end);
19418 __tmp.put_u8(self.target_system);
19419 __tmp.put_u8(self.target_component);
19420 if matches!(version, MavlinkVersion::V2) {
19421 let len = __tmp.len();
19422 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19423 } else {
19424 __tmp.len()
19425 }
19426 }
19427}
19428#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
19429#[doc = ""]
19430#[doc = "ID: 192"]
19431#[derive(Debug, Clone, PartialEq)]
19432#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19433#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19434#[cfg_attr(feature = "ts", derive(TS))]
19435#[cfg_attr(feature = "ts", ts(export))]
19436pub struct MAG_CAL_REPORT_DATA {
19437 #[doc = "RMS milligauss residuals."]
19438 pub fitness: f32,
19439 #[doc = "X offset."]
19440 pub ofs_x: f32,
19441 #[doc = "Y offset."]
19442 pub ofs_y: f32,
19443 #[doc = "Z offset."]
19444 pub ofs_z: f32,
19445 #[doc = "X diagonal (matrix 11)."]
19446 pub diag_x: f32,
19447 #[doc = "Y diagonal (matrix 22)."]
19448 pub diag_y: f32,
19449 #[doc = "Z diagonal (matrix 33)."]
19450 pub diag_z: f32,
19451 #[doc = "X off-diagonal (matrix 12 and 21)."]
19452 pub offdiag_x: f32,
19453 #[doc = "Y off-diagonal (matrix 13 and 31)."]
19454 pub offdiag_y: f32,
19455 #[doc = "Z off-diagonal (matrix 32 and 23)."]
19456 pub offdiag_z: f32,
19457 #[doc = "Compass being calibrated."]
19458 pub compass_id: u8,
19459 #[doc = "Bitmask of compasses being calibrated."]
19460 pub cal_mask: u8,
19461 #[doc = "Calibration Status."]
19462 pub cal_status: MagCalStatus,
19463 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
19464 pub autosaved: u8,
19465 #[doc = "Confidence in orientation (higher is better)."]
19466 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19467 pub orientation_confidence: f32,
19468 #[doc = "orientation before calibration."]
19469 #[cfg_attr(feature = "serde", serde(default))]
19470 pub old_orientation: MavSensorOrientation,
19471 #[doc = "orientation after calibration."]
19472 #[cfg_attr(feature = "serde", serde(default))]
19473 pub new_orientation: MavSensorOrientation,
19474 #[doc = "field radius correction factor"]
19475 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19476 pub scale_factor: f32,
19477}
19478impl MAG_CAL_REPORT_DATA {
19479 pub const ENCODED_LEN: usize = 54usize;
19480 pub const DEFAULT: Self = Self {
19481 fitness: 0.0_f32,
19482 ofs_x: 0.0_f32,
19483 ofs_y: 0.0_f32,
19484 ofs_z: 0.0_f32,
19485 diag_x: 0.0_f32,
19486 diag_y: 0.0_f32,
19487 diag_z: 0.0_f32,
19488 offdiag_x: 0.0_f32,
19489 offdiag_y: 0.0_f32,
19490 offdiag_z: 0.0_f32,
19491 compass_id: 0_u8,
19492 cal_mask: 0_u8,
19493 cal_status: MagCalStatus::DEFAULT,
19494 autosaved: 0_u8,
19495 orientation_confidence: 0.0_f32,
19496 old_orientation: MavSensorOrientation::DEFAULT,
19497 new_orientation: MavSensorOrientation::DEFAULT,
19498 scale_factor: 0.0_f32,
19499 };
19500 #[cfg(feature = "arbitrary")]
19501 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19502 use arbitrary::{Arbitrary, Unstructured};
19503 let mut buf = [0u8; 1024];
19504 rng.fill_bytes(&mut buf);
19505 let mut unstructured = Unstructured::new(&buf);
19506 Self::arbitrary(&mut unstructured).unwrap_or_default()
19507 }
19508}
19509impl Default for MAG_CAL_REPORT_DATA {
19510 fn default() -> Self {
19511 Self::DEFAULT.clone()
19512 }
19513}
19514impl MessageData for MAG_CAL_REPORT_DATA {
19515 type Message = MavMessage;
19516 const ID: u32 = 192u32;
19517 const NAME: &'static str = "MAG_CAL_REPORT";
19518 const EXTRA_CRC: u8 = 36u8;
19519 const ENCODED_LEN: usize = 54usize;
19520 fn deser(
19521 _version: MavlinkVersion,
19522 __input: &[u8],
19523 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19524 let avail_len = __input.len();
19525 let mut payload_buf = [0; Self::ENCODED_LEN];
19526 let mut buf = if avail_len < Self::ENCODED_LEN {
19527 payload_buf[0..avail_len].copy_from_slice(__input);
19528 Bytes::new(&payload_buf)
19529 } else {
19530 Bytes::new(__input)
19531 };
19532 let mut __struct = Self::default();
19533 __struct.fitness = buf.get_f32_le()?;
19534 __struct.ofs_x = buf.get_f32_le()?;
19535 __struct.ofs_y = buf.get_f32_le()?;
19536 __struct.ofs_z = buf.get_f32_le()?;
19537 __struct.diag_x = buf.get_f32_le()?;
19538 __struct.diag_y = buf.get_f32_le()?;
19539 __struct.diag_z = buf.get_f32_le()?;
19540 __struct.offdiag_x = buf.get_f32_le()?;
19541 __struct.offdiag_y = buf.get_f32_le()?;
19542 __struct.offdiag_z = buf.get_f32_le()?;
19543 __struct.compass_id = buf.get_u8()?;
19544 __struct.cal_mask = buf.get_u8()?;
19545 let tmp = buf.get_u8()?;
19546 __struct.cal_status =
19547 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19548 enum_type: "MagCalStatus",
19549 value: tmp as u64,
19550 })?;
19551 __struct.autosaved = buf.get_u8()?;
19552 __struct.orientation_confidence = buf.get_f32_le()?;
19553 let tmp = buf.get_u8()?;
19554 __struct.old_orientation =
19555 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19556 enum_type: "MavSensorOrientation",
19557 value: tmp as u64,
19558 })?;
19559 let tmp = buf.get_u8()?;
19560 __struct.new_orientation =
19561 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19562 enum_type: "MavSensorOrientation",
19563 value: tmp as u64,
19564 })?;
19565 __struct.scale_factor = buf.get_f32_le()?;
19566 Ok(__struct)
19567 }
19568 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19569 let mut __tmp = BytesMut::new(bytes);
19570 #[allow(clippy::absurd_extreme_comparisons)]
19571 #[allow(unused_comparisons)]
19572 if __tmp.remaining() < Self::ENCODED_LEN {
19573 panic!(
19574 "buffer is too small (need {} bytes, but got {})",
19575 Self::ENCODED_LEN,
19576 __tmp.remaining(),
19577 )
19578 }
19579 __tmp.put_f32_le(self.fitness);
19580 __tmp.put_f32_le(self.ofs_x);
19581 __tmp.put_f32_le(self.ofs_y);
19582 __tmp.put_f32_le(self.ofs_z);
19583 __tmp.put_f32_le(self.diag_x);
19584 __tmp.put_f32_le(self.diag_y);
19585 __tmp.put_f32_le(self.diag_z);
19586 __tmp.put_f32_le(self.offdiag_x);
19587 __tmp.put_f32_le(self.offdiag_y);
19588 __tmp.put_f32_le(self.offdiag_z);
19589 __tmp.put_u8(self.compass_id);
19590 __tmp.put_u8(self.cal_mask);
19591 __tmp.put_u8(self.cal_status as u8);
19592 __tmp.put_u8(self.autosaved);
19593 if matches!(version, MavlinkVersion::V2) {
19594 __tmp.put_f32_le(self.orientation_confidence);
19595 __tmp.put_u8(self.old_orientation as u8);
19596 __tmp.put_u8(self.new_orientation as u8);
19597 __tmp.put_f32_le(self.scale_factor);
19598 let len = __tmp.len();
19599 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19600 } else {
19601 __tmp.len()
19602 }
19603 }
19604}
19605#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
19606#[doc = ""]
19607#[doc = "ID: 69"]
19608#[derive(Debug, Clone, PartialEq)]
19609#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19610#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19611#[cfg_attr(feature = "ts", derive(TS))]
19612#[cfg_attr(feature = "ts", ts(export))]
19613pub struct MANUAL_CONTROL_DATA {
19614 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
19615 pub x: i16,
19616 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
19617 pub y: i16,
19618 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
19619 pub z: i16,
19620 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
19621 pub r: i16,
19622 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
19623 pub buttons: u16,
19624 #[doc = "The system to be controlled."]
19625 pub target: u8,
19626 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
19627 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19628 pub buttons2: u16,
19629 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
19630 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19631 pub enabled_extensions: u8,
19632 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
19633 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19634 pub s: i16,
19635 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
19636 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19637 pub t: i16,
19638 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
19639 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19640 pub aux1: i16,
19641 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
19642 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19643 pub aux2: i16,
19644 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
19645 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19646 pub aux3: i16,
19647 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
19648 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19649 pub aux4: i16,
19650 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
19651 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19652 pub aux5: i16,
19653 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
19654 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19655 pub aux6: i16,
19656}
19657impl MANUAL_CONTROL_DATA {
19658 pub const ENCODED_LEN: usize = 30usize;
19659 pub const DEFAULT: Self = Self {
19660 x: 0_i16,
19661 y: 0_i16,
19662 z: 0_i16,
19663 r: 0_i16,
19664 buttons: 0_u16,
19665 target: 0_u8,
19666 buttons2: 0_u16,
19667 enabled_extensions: 0_u8,
19668 s: 0_i16,
19669 t: 0_i16,
19670 aux1: 0_i16,
19671 aux2: 0_i16,
19672 aux3: 0_i16,
19673 aux4: 0_i16,
19674 aux5: 0_i16,
19675 aux6: 0_i16,
19676 };
19677 #[cfg(feature = "arbitrary")]
19678 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19679 use arbitrary::{Arbitrary, Unstructured};
19680 let mut buf = [0u8; 1024];
19681 rng.fill_bytes(&mut buf);
19682 let mut unstructured = Unstructured::new(&buf);
19683 Self::arbitrary(&mut unstructured).unwrap_or_default()
19684 }
19685}
19686impl Default for MANUAL_CONTROL_DATA {
19687 fn default() -> Self {
19688 Self::DEFAULT.clone()
19689 }
19690}
19691impl MessageData for MANUAL_CONTROL_DATA {
19692 type Message = MavMessage;
19693 const ID: u32 = 69u32;
19694 const NAME: &'static str = "MANUAL_CONTROL";
19695 const EXTRA_CRC: u8 = 243u8;
19696 const ENCODED_LEN: usize = 30usize;
19697 fn deser(
19698 _version: MavlinkVersion,
19699 __input: &[u8],
19700 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19701 let avail_len = __input.len();
19702 let mut payload_buf = [0; Self::ENCODED_LEN];
19703 let mut buf = if avail_len < Self::ENCODED_LEN {
19704 payload_buf[0..avail_len].copy_from_slice(__input);
19705 Bytes::new(&payload_buf)
19706 } else {
19707 Bytes::new(__input)
19708 };
19709 let mut __struct = Self::default();
19710 __struct.x = buf.get_i16_le()?;
19711 __struct.y = buf.get_i16_le()?;
19712 __struct.z = buf.get_i16_le()?;
19713 __struct.r = buf.get_i16_le()?;
19714 __struct.buttons = buf.get_u16_le()?;
19715 __struct.target = buf.get_u8()?;
19716 __struct.buttons2 = buf.get_u16_le()?;
19717 __struct.enabled_extensions = buf.get_u8()?;
19718 __struct.s = buf.get_i16_le()?;
19719 __struct.t = buf.get_i16_le()?;
19720 __struct.aux1 = buf.get_i16_le()?;
19721 __struct.aux2 = buf.get_i16_le()?;
19722 __struct.aux3 = buf.get_i16_le()?;
19723 __struct.aux4 = buf.get_i16_le()?;
19724 __struct.aux5 = buf.get_i16_le()?;
19725 __struct.aux6 = buf.get_i16_le()?;
19726 Ok(__struct)
19727 }
19728 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19729 let mut __tmp = BytesMut::new(bytes);
19730 #[allow(clippy::absurd_extreme_comparisons)]
19731 #[allow(unused_comparisons)]
19732 if __tmp.remaining() < Self::ENCODED_LEN {
19733 panic!(
19734 "buffer is too small (need {} bytes, but got {})",
19735 Self::ENCODED_LEN,
19736 __tmp.remaining(),
19737 )
19738 }
19739 __tmp.put_i16_le(self.x);
19740 __tmp.put_i16_le(self.y);
19741 __tmp.put_i16_le(self.z);
19742 __tmp.put_i16_le(self.r);
19743 __tmp.put_u16_le(self.buttons);
19744 __tmp.put_u8(self.target);
19745 if matches!(version, MavlinkVersion::V2) {
19746 __tmp.put_u16_le(self.buttons2);
19747 __tmp.put_u8(self.enabled_extensions);
19748 __tmp.put_i16_le(self.s);
19749 __tmp.put_i16_le(self.t);
19750 __tmp.put_i16_le(self.aux1);
19751 __tmp.put_i16_le(self.aux2);
19752 __tmp.put_i16_le(self.aux3);
19753 __tmp.put_i16_le(self.aux4);
19754 __tmp.put_i16_le(self.aux5);
19755 __tmp.put_i16_le(self.aux6);
19756 let len = __tmp.len();
19757 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19758 } else {
19759 __tmp.len()
19760 }
19761 }
19762}
19763#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
19764#[doc = ""]
19765#[doc = "ID: 81"]
19766#[derive(Debug, Clone, PartialEq)]
19767#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19768#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19769#[cfg_attr(feature = "ts", derive(TS))]
19770#[cfg_attr(feature = "ts", ts(export))]
19771pub struct MANUAL_SETPOINT_DATA {
19772 #[doc = "Timestamp (time since system boot)."]
19773 pub time_boot_ms: u32,
19774 #[doc = "Desired roll rate"]
19775 pub roll: f32,
19776 #[doc = "Desired pitch rate"]
19777 pub pitch: f32,
19778 #[doc = "Desired yaw rate"]
19779 pub yaw: f32,
19780 #[doc = "Collective thrust, normalized to 0 .. 1"]
19781 pub thrust: f32,
19782 #[doc = "Flight mode switch position, 0.. 255"]
19783 pub mode_switch: u8,
19784 #[doc = "Override mode switch position, 0.. 255"]
19785 pub manual_override_switch: u8,
19786}
19787impl MANUAL_SETPOINT_DATA {
19788 pub const ENCODED_LEN: usize = 22usize;
19789 pub const DEFAULT: Self = Self {
19790 time_boot_ms: 0_u32,
19791 roll: 0.0_f32,
19792 pitch: 0.0_f32,
19793 yaw: 0.0_f32,
19794 thrust: 0.0_f32,
19795 mode_switch: 0_u8,
19796 manual_override_switch: 0_u8,
19797 };
19798 #[cfg(feature = "arbitrary")]
19799 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19800 use arbitrary::{Arbitrary, Unstructured};
19801 let mut buf = [0u8; 1024];
19802 rng.fill_bytes(&mut buf);
19803 let mut unstructured = Unstructured::new(&buf);
19804 Self::arbitrary(&mut unstructured).unwrap_or_default()
19805 }
19806}
19807impl Default for MANUAL_SETPOINT_DATA {
19808 fn default() -> Self {
19809 Self::DEFAULT.clone()
19810 }
19811}
19812impl MessageData for MANUAL_SETPOINT_DATA {
19813 type Message = MavMessage;
19814 const ID: u32 = 81u32;
19815 const NAME: &'static str = "MANUAL_SETPOINT";
19816 const EXTRA_CRC: u8 = 106u8;
19817 const ENCODED_LEN: usize = 22usize;
19818 fn deser(
19819 _version: MavlinkVersion,
19820 __input: &[u8],
19821 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19822 let avail_len = __input.len();
19823 let mut payload_buf = [0; Self::ENCODED_LEN];
19824 let mut buf = if avail_len < Self::ENCODED_LEN {
19825 payload_buf[0..avail_len].copy_from_slice(__input);
19826 Bytes::new(&payload_buf)
19827 } else {
19828 Bytes::new(__input)
19829 };
19830 let mut __struct = Self::default();
19831 __struct.time_boot_ms = buf.get_u32_le()?;
19832 __struct.roll = buf.get_f32_le()?;
19833 __struct.pitch = buf.get_f32_le()?;
19834 __struct.yaw = buf.get_f32_le()?;
19835 __struct.thrust = buf.get_f32_le()?;
19836 __struct.mode_switch = buf.get_u8()?;
19837 __struct.manual_override_switch = buf.get_u8()?;
19838 Ok(__struct)
19839 }
19840 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19841 let mut __tmp = BytesMut::new(bytes);
19842 #[allow(clippy::absurd_extreme_comparisons)]
19843 #[allow(unused_comparisons)]
19844 if __tmp.remaining() < Self::ENCODED_LEN {
19845 panic!(
19846 "buffer is too small (need {} bytes, but got {})",
19847 Self::ENCODED_LEN,
19848 __tmp.remaining(),
19849 )
19850 }
19851 __tmp.put_u32_le(self.time_boot_ms);
19852 __tmp.put_f32_le(self.roll);
19853 __tmp.put_f32_le(self.pitch);
19854 __tmp.put_f32_le(self.yaw);
19855 __tmp.put_f32_le(self.thrust);
19856 __tmp.put_u8(self.mode_switch);
19857 __tmp.put_u8(self.manual_override_switch);
19858 if matches!(version, MavlinkVersion::V2) {
19859 let len = __tmp.len();
19860 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19861 } else {
19862 __tmp.len()
19863 }
19864 }
19865}
19866#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
19867#[doc = ""]
19868#[doc = "ID: 249"]
19869#[derive(Debug, Clone, PartialEq)]
19870#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19871#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19872#[cfg_attr(feature = "ts", derive(TS))]
19873#[cfg_attr(feature = "ts", ts(export))]
19874pub struct MEMORY_VECT_DATA {
19875 #[doc = "Starting address of the debug variables"]
19876 pub address: u16,
19877 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
19878 pub ver: u8,
19879 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
19880 pub mavtype: u8,
19881 #[doc = "Memory contents at specified address"]
19882 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19883 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
19884 pub value: [i8; 32],
19885}
19886impl MEMORY_VECT_DATA {
19887 pub const ENCODED_LEN: usize = 36usize;
19888 pub const DEFAULT: Self = Self {
19889 address: 0_u16,
19890 ver: 0_u8,
19891 mavtype: 0_u8,
19892 value: [0_i8; 32usize],
19893 };
19894 #[cfg(feature = "arbitrary")]
19895 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19896 use arbitrary::{Arbitrary, Unstructured};
19897 let mut buf = [0u8; 1024];
19898 rng.fill_bytes(&mut buf);
19899 let mut unstructured = Unstructured::new(&buf);
19900 Self::arbitrary(&mut unstructured).unwrap_or_default()
19901 }
19902}
19903impl Default for MEMORY_VECT_DATA {
19904 fn default() -> Self {
19905 Self::DEFAULT.clone()
19906 }
19907}
19908impl MessageData for MEMORY_VECT_DATA {
19909 type Message = MavMessage;
19910 const ID: u32 = 249u32;
19911 const NAME: &'static str = "MEMORY_VECT";
19912 const EXTRA_CRC: u8 = 204u8;
19913 const ENCODED_LEN: usize = 36usize;
19914 fn deser(
19915 _version: MavlinkVersion,
19916 __input: &[u8],
19917 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19918 let avail_len = __input.len();
19919 let mut payload_buf = [0; Self::ENCODED_LEN];
19920 let mut buf = if avail_len < Self::ENCODED_LEN {
19921 payload_buf[0..avail_len].copy_from_slice(__input);
19922 Bytes::new(&payload_buf)
19923 } else {
19924 Bytes::new(__input)
19925 };
19926 let mut __struct = Self::default();
19927 __struct.address = buf.get_u16_le()?;
19928 __struct.ver = buf.get_u8()?;
19929 __struct.mavtype = buf.get_u8()?;
19930 for v in &mut __struct.value {
19931 let val = buf.get_i8()?;
19932 *v = val;
19933 }
19934 Ok(__struct)
19935 }
19936 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19937 let mut __tmp = BytesMut::new(bytes);
19938 #[allow(clippy::absurd_extreme_comparisons)]
19939 #[allow(unused_comparisons)]
19940 if __tmp.remaining() < Self::ENCODED_LEN {
19941 panic!(
19942 "buffer is too small (need {} bytes, but got {})",
19943 Self::ENCODED_LEN,
19944 __tmp.remaining(),
19945 )
19946 }
19947 __tmp.put_u16_le(self.address);
19948 __tmp.put_u8(self.ver);
19949 __tmp.put_u8(self.mavtype);
19950 for val in &self.value {
19951 __tmp.put_i8(*val);
19952 }
19953 if matches!(version, MavlinkVersion::V2) {
19954 let len = __tmp.len();
19955 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19956 } else {
19957 __tmp.len()
19958 }
19959 }
19960}
19961#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
19962#[doc = ""]
19963#[doc = "ID: 244"]
19964#[derive(Debug, Clone, PartialEq)]
19965#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19966#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19967#[cfg_attr(feature = "ts", derive(TS))]
19968#[cfg_attr(feature = "ts", ts(export))]
19969pub struct MESSAGE_INTERVAL_DATA {
19970 #[doc = "The interval between two messages. A value of -1 indicates this stream is disabled, 0 indicates it is not available,>0 indicates the interval at which it is sent."]
19971 pub interval_us: i32,
19972 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
19973 pub message_id: u16,
19974}
19975impl MESSAGE_INTERVAL_DATA {
19976 pub const ENCODED_LEN: usize = 6usize;
19977 pub const DEFAULT: Self = Self {
19978 interval_us: 0_i32,
19979 message_id: 0_u16,
19980 };
19981 #[cfg(feature = "arbitrary")]
19982 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19983 use arbitrary::{Arbitrary, Unstructured};
19984 let mut buf = [0u8; 1024];
19985 rng.fill_bytes(&mut buf);
19986 let mut unstructured = Unstructured::new(&buf);
19987 Self::arbitrary(&mut unstructured).unwrap_or_default()
19988 }
19989}
19990impl Default for MESSAGE_INTERVAL_DATA {
19991 fn default() -> Self {
19992 Self::DEFAULT.clone()
19993 }
19994}
19995impl MessageData for MESSAGE_INTERVAL_DATA {
19996 type Message = MavMessage;
19997 const ID: u32 = 244u32;
19998 const NAME: &'static str = "MESSAGE_INTERVAL";
19999 const EXTRA_CRC: u8 = 95u8;
20000 const ENCODED_LEN: usize = 6usize;
20001 fn deser(
20002 _version: MavlinkVersion,
20003 __input: &[u8],
20004 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20005 let avail_len = __input.len();
20006 let mut payload_buf = [0; Self::ENCODED_LEN];
20007 let mut buf = if avail_len < Self::ENCODED_LEN {
20008 payload_buf[0..avail_len].copy_from_slice(__input);
20009 Bytes::new(&payload_buf)
20010 } else {
20011 Bytes::new(__input)
20012 };
20013 let mut __struct = Self::default();
20014 __struct.interval_us = buf.get_i32_le()?;
20015 __struct.message_id = buf.get_u16_le()?;
20016 Ok(__struct)
20017 }
20018 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20019 let mut __tmp = BytesMut::new(bytes);
20020 #[allow(clippy::absurd_extreme_comparisons)]
20021 #[allow(unused_comparisons)]
20022 if __tmp.remaining() < Self::ENCODED_LEN {
20023 panic!(
20024 "buffer is too small (need {} bytes, but got {})",
20025 Self::ENCODED_LEN,
20026 __tmp.remaining(),
20027 )
20028 }
20029 __tmp.put_i32_le(self.interval_us);
20030 __tmp.put_u16_le(self.message_id);
20031 if matches!(version, MavlinkVersion::V2) {
20032 let len = __tmp.len();
20033 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20034 } else {
20035 __tmp.len()
20036 }
20037 }
20038}
20039#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
20040#[doc = ""]
20041#[doc = "ID: 47"]
20042#[derive(Debug, Clone, PartialEq)]
20043#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20044#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20045#[cfg_attr(feature = "ts", derive(TS))]
20046#[cfg_attr(feature = "ts", ts(export))]
20047pub struct MISSION_ACK_DATA {
20048 #[doc = "System ID"]
20049 pub target_system: u8,
20050 #[doc = "Component ID"]
20051 pub target_component: u8,
20052 #[doc = "Mission result."]
20053 pub mavtype: MavMissionResult,
20054 #[doc = "Mission type."]
20055 #[cfg_attr(feature = "serde", serde(default))]
20056 pub mission_type: MavMissionType,
20057 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
20058 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20059 pub opaque_id: u32,
20060}
20061impl MISSION_ACK_DATA {
20062 pub const ENCODED_LEN: usize = 8usize;
20063 pub const DEFAULT: Self = Self {
20064 target_system: 0_u8,
20065 target_component: 0_u8,
20066 mavtype: MavMissionResult::DEFAULT,
20067 mission_type: MavMissionType::DEFAULT,
20068 opaque_id: 0_u32,
20069 };
20070 #[cfg(feature = "arbitrary")]
20071 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20072 use arbitrary::{Arbitrary, Unstructured};
20073 let mut buf = [0u8; 1024];
20074 rng.fill_bytes(&mut buf);
20075 let mut unstructured = Unstructured::new(&buf);
20076 Self::arbitrary(&mut unstructured).unwrap_or_default()
20077 }
20078}
20079impl Default for MISSION_ACK_DATA {
20080 fn default() -> Self {
20081 Self::DEFAULT.clone()
20082 }
20083}
20084impl MessageData for MISSION_ACK_DATA {
20085 type Message = MavMessage;
20086 const ID: u32 = 47u32;
20087 const NAME: &'static str = "MISSION_ACK";
20088 const EXTRA_CRC: u8 = 153u8;
20089 const ENCODED_LEN: usize = 8usize;
20090 fn deser(
20091 _version: MavlinkVersion,
20092 __input: &[u8],
20093 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20094 let avail_len = __input.len();
20095 let mut payload_buf = [0; Self::ENCODED_LEN];
20096 let mut buf = if avail_len < Self::ENCODED_LEN {
20097 payload_buf[0..avail_len].copy_from_slice(__input);
20098 Bytes::new(&payload_buf)
20099 } else {
20100 Bytes::new(__input)
20101 };
20102 let mut __struct = Self::default();
20103 __struct.target_system = buf.get_u8()?;
20104 __struct.target_component = buf.get_u8()?;
20105 let tmp = buf.get_u8()?;
20106 __struct.mavtype =
20107 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20108 enum_type: "MavMissionResult",
20109 value: tmp as u64,
20110 })?;
20111 let tmp = buf.get_u8()?;
20112 __struct.mission_type =
20113 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20114 enum_type: "MavMissionType",
20115 value: tmp as u64,
20116 })?;
20117 __struct.opaque_id = buf.get_u32_le()?;
20118 Ok(__struct)
20119 }
20120 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20121 let mut __tmp = BytesMut::new(bytes);
20122 #[allow(clippy::absurd_extreme_comparisons)]
20123 #[allow(unused_comparisons)]
20124 if __tmp.remaining() < Self::ENCODED_LEN {
20125 panic!(
20126 "buffer is too small (need {} bytes, but got {})",
20127 Self::ENCODED_LEN,
20128 __tmp.remaining(),
20129 )
20130 }
20131 __tmp.put_u8(self.target_system);
20132 __tmp.put_u8(self.target_component);
20133 __tmp.put_u8(self.mavtype as u8);
20134 if matches!(version, MavlinkVersion::V2) {
20135 __tmp.put_u8(self.mission_type as u8);
20136 __tmp.put_u32_le(self.opaque_id);
20137 let len = __tmp.len();
20138 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20139 } else {
20140 __tmp.len()
20141 }
20142 }
20143}
20144#[doc = "Delete all mission items at once."]
20145#[doc = ""]
20146#[doc = "ID: 45"]
20147#[derive(Debug, Clone, PartialEq)]
20148#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20149#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20150#[cfg_attr(feature = "ts", derive(TS))]
20151#[cfg_attr(feature = "ts", ts(export))]
20152pub struct MISSION_CLEAR_ALL_DATA {
20153 #[doc = "System ID"]
20154 pub target_system: u8,
20155 #[doc = "Component ID"]
20156 pub target_component: u8,
20157 #[doc = "Mission type."]
20158 #[cfg_attr(feature = "serde", serde(default))]
20159 pub mission_type: MavMissionType,
20160}
20161impl MISSION_CLEAR_ALL_DATA {
20162 pub const ENCODED_LEN: usize = 3usize;
20163 pub const DEFAULT: Self = Self {
20164 target_system: 0_u8,
20165 target_component: 0_u8,
20166 mission_type: MavMissionType::DEFAULT,
20167 };
20168 #[cfg(feature = "arbitrary")]
20169 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20170 use arbitrary::{Arbitrary, Unstructured};
20171 let mut buf = [0u8; 1024];
20172 rng.fill_bytes(&mut buf);
20173 let mut unstructured = Unstructured::new(&buf);
20174 Self::arbitrary(&mut unstructured).unwrap_or_default()
20175 }
20176}
20177impl Default for MISSION_CLEAR_ALL_DATA {
20178 fn default() -> Self {
20179 Self::DEFAULT.clone()
20180 }
20181}
20182impl MessageData for MISSION_CLEAR_ALL_DATA {
20183 type Message = MavMessage;
20184 const ID: u32 = 45u32;
20185 const NAME: &'static str = "MISSION_CLEAR_ALL";
20186 const EXTRA_CRC: u8 = 232u8;
20187 const ENCODED_LEN: usize = 3usize;
20188 fn deser(
20189 _version: MavlinkVersion,
20190 __input: &[u8],
20191 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20192 let avail_len = __input.len();
20193 let mut payload_buf = [0; Self::ENCODED_LEN];
20194 let mut buf = if avail_len < Self::ENCODED_LEN {
20195 payload_buf[0..avail_len].copy_from_slice(__input);
20196 Bytes::new(&payload_buf)
20197 } else {
20198 Bytes::new(__input)
20199 };
20200 let mut __struct = Self::default();
20201 __struct.target_system = buf.get_u8()?;
20202 __struct.target_component = buf.get_u8()?;
20203 let tmp = buf.get_u8()?;
20204 __struct.mission_type =
20205 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20206 enum_type: "MavMissionType",
20207 value: tmp as u64,
20208 })?;
20209 Ok(__struct)
20210 }
20211 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20212 let mut __tmp = BytesMut::new(bytes);
20213 #[allow(clippy::absurd_extreme_comparisons)]
20214 #[allow(unused_comparisons)]
20215 if __tmp.remaining() < Self::ENCODED_LEN {
20216 panic!(
20217 "buffer is too small (need {} bytes, but got {})",
20218 Self::ENCODED_LEN,
20219 __tmp.remaining(),
20220 )
20221 }
20222 __tmp.put_u8(self.target_system);
20223 __tmp.put_u8(self.target_component);
20224 if matches!(version, MavlinkVersion::V2) {
20225 __tmp.put_u8(self.mission_type as u8);
20226 let len = __tmp.len();
20227 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20228 } else {
20229 __tmp.len()
20230 }
20231 }
20232}
20233#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
20234#[doc = ""]
20235#[doc = "ID: 44"]
20236#[derive(Debug, Clone, PartialEq)]
20237#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20238#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20239#[cfg_attr(feature = "ts", derive(TS))]
20240#[cfg_attr(feature = "ts", ts(export))]
20241pub struct MISSION_COUNT_DATA {
20242 #[doc = "Number of mission items in the sequence"]
20243 pub count: u16,
20244 #[doc = "System ID"]
20245 pub target_system: u8,
20246 #[doc = "Component ID"]
20247 pub target_component: u8,
20248 #[doc = "Mission type."]
20249 #[cfg_attr(feature = "serde", serde(default))]
20250 pub mission_type: MavMissionType,
20251 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
20252 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20253 pub opaque_id: u32,
20254}
20255impl MISSION_COUNT_DATA {
20256 pub const ENCODED_LEN: usize = 9usize;
20257 pub const DEFAULT: Self = Self {
20258 count: 0_u16,
20259 target_system: 0_u8,
20260 target_component: 0_u8,
20261 mission_type: MavMissionType::DEFAULT,
20262 opaque_id: 0_u32,
20263 };
20264 #[cfg(feature = "arbitrary")]
20265 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20266 use arbitrary::{Arbitrary, Unstructured};
20267 let mut buf = [0u8; 1024];
20268 rng.fill_bytes(&mut buf);
20269 let mut unstructured = Unstructured::new(&buf);
20270 Self::arbitrary(&mut unstructured).unwrap_or_default()
20271 }
20272}
20273impl Default for MISSION_COUNT_DATA {
20274 fn default() -> Self {
20275 Self::DEFAULT.clone()
20276 }
20277}
20278impl MessageData for MISSION_COUNT_DATA {
20279 type Message = MavMessage;
20280 const ID: u32 = 44u32;
20281 const NAME: &'static str = "MISSION_COUNT";
20282 const EXTRA_CRC: u8 = 221u8;
20283 const ENCODED_LEN: usize = 9usize;
20284 fn deser(
20285 _version: MavlinkVersion,
20286 __input: &[u8],
20287 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20288 let avail_len = __input.len();
20289 let mut payload_buf = [0; Self::ENCODED_LEN];
20290 let mut buf = if avail_len < Self::ENCODED_LEN {
20291 payload_buf[0..avail_len].copy_from_slice(__input);
20292 Bytes::new(&payload_buf)
20293 } else {
20294 Bytes::new(__input)
20295 };
20296 let mut __struct = Self::default();
20297 __struct.count = buf.get_u16_le()?;
20298 __struct.target_system = buf.get_u8()?;
20299 __struct.target_component = buf.get_u8()?;
20300 let tmp = buf.get_u8()?;
20301 __struct.mission_type =
20302 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20303 enum_type: "MavMissionType",
20304 value: tmp as u64,
20305 })?;
20306 __struct.opaque_id = buf.get_u32_le()?;
20307 Ok(__struct)
20308 }
20309 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20310 let mut __tmp = BytesMut::new(bytes);
20311 #[allow(clippy::absurd_extreme_comparisons)]
20312 #[allow(unused_comparisons)]
20313 if __tmp.remaining() < Self::ENCODED_LEN {
20314 panic!(
20315 "buffer is too small (need {} bytes, but got {})",
20316 Self::ENCODED_LEN,
20317 __tmp.remaining(),
20318 )
20319 }
20320 __tmp.put_u16_le(self.count);
20321 __tmp.put_u8(self.target_system);
20322 __tmp.put_u8(self.target_component);
20323 if matches!(version, MavlinkVersion::V2) {
20324 __tmp.put_u8(self.mission_type as u8);
20325 __tmp.put_u32_le(self.opaque_id);
20326 let len = __tmp.len();
20327 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20328 } else {
20329 __tmp.len()
20330 }
20331 }
20332}
20333#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
20334#[doc = ""]
20335#[doc = "ID: 42"]
20336#[derive(Debug, Clone, PartialEq)]
20337#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20338#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20339#[cfg_attr(feature = "ts", derive(TS))]
20340#[cfg_attr(feature = "ts", ts(export))]
20341pub struct MISSION_CURRENT_DATA {
20342 #[doc = "Sequence"]
20343 pub seq: u16,
20344 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
20345 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20346 pub total: u16,
20347 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
20348 #[cfg_attr(feature = "serde", serde(default))]
20349 pub mission_state: MissionState,
20350 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
20351 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20352 pub mission_mode: u8,
20353 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
20354 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20355 pub mission_id: u32,
20356 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
20357 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20358 pub fence_id: u32,
20359 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
20360 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20361 pub rally_points_id: u32,
20362}
20363impl MISSION_CURRENT_DATA {
20364 pub const ENCODED_LEN: usize = 18usize;
20365 pub const DEFAULT: Self = Self {
20366 seq: 0_u16,
20367 total: 0_u16,
20368 mission_state: MissionState::DEFAULT,
20369 mission_mode: 0_u8,
20370 mission_id: 0_u32,
20371 fence_id: 0_u32,
20372 rally_points_id: 0_u32,
20373 };
20374 #[cfg(feature = "arbitrary")]
20375 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20376 use arbitrary::{Arbitrary, Unstructured};
20377 let mut buf = [0u8; 1024];
20378 rng.fill_bytes(&mut buf);
20379 let mut unstructured = Unstructured::new(&buf);
20380 Self::arbitrary(&mut unstructured).unwrap_or_default()
20381 }
20382}
20383impl Default for MISSION_CURRENT_DATA {
20384 fn default() -> Self {
20385 Self::DEFAULT.clone()
20386 }
20387}
20388impl MessageData for MISSION_CURRENT_DATA {
20389 type Message = MavMessage;
20390 const ID: u32 = 42u32;
20391 const NAME: &'static str = "MISSION_CURRENT";
20392 const EXTRA_CRC: u8 = 28u8;
20393 const ENCODED_LEN: usize = 18usize;
20394 fn deser(
20395 _version: MavlinkVersion,
20396 __input: &[u8],
20397 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20398 let avail_len = __input.len();
20399 let mut payload_buf = [0; Self::ENCODED_LEN];
20400 let mut buf = if avail_len < Self::ENCODED_LEN {
20401 payload_buf[0..avail_len].copy_from_slice(__input);
20402 Bytes::new(&payload_buf)
20403 } else {
20404 Bytes::new(__input)
20405 };
20406 let mut __struct = Self::default();
20407 __struct.seq = buf.get_u16_le()?;
20408 __struct.total = buf.get_u16_le()?;
20409 let tmp = buf.get_u8()?;
20410 __struct.mission_state =
20411 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20412 enum_type: "MissionState",
20413 value: tmp as u64,
20414 })?;
20415 __struct.mission_mode = buf.get_u8()?;
20416 __struct.mission_id = buf.get_u32_le()?;
20417 __struct.fence_id = buf.get_u32_le()?;
20418 __struct.rally_points_id = buf.get_u32_le()?;
20419 Ok(__struct)
20420 }
20421 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20422 let mut __tmp = BytesMut::new(bytes);
20423 #[allow(clippy::absurd_extreme_comparisons)]
20424 #[allow(unused_comparisons)]
20425 if __tmp.remaining() < Self::ENCODED_LEN {
20426 panic!(
20427 "buffer is too small (need {} bytes, but got {})",
20428 Self::ENCODED_LEN,
20429 __tmp.remaining(),
20430 )
20431 }
20432 __tmp.put_u16_le(self.seq);
20433 if matches!(version, MavlinkVersion::V2) {
20434 __tmp.put_u16_le(self.total);
20435 __tmp.put_u8(self.mission_state as u8);
20436 __tmp.put_u8(self.mission_mode);
20437 __tmp.put_u32_le(self.mission_id);
20438 __tmp.put_u32_le(self.fence_id);
20439 __tmp.put_u32_le(self.rally_points_id);
20440 let len = __tmp.len();
20441 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20442 } else {
20443 __tmp.len()
20444 }
20445 }
20446}
20447#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
20448#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
20449#[doc = ""]
20450#[doc = "ID: 39"]
20451#[derive(Debug, Clone, PartialEq)]
20452#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20453#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20454#[cfg_attr(feature = "ts", derive(TS))]
20455#[cfg_attr(feature = "ts", ts(export))]
20456pub struct MISSION_ITEM_DATA {
20457 #[doc = "PARAM1, see MAV_CMD enum"]
20458 pub param1: f32,
20459 #[doc = "PARAM2, see MAV_CMD enum"]
20460 pub param2: f32,
20461 #[doc = "PARAM3, see MAV_CMD enum"]
20462 pub param3: f32,
20463 #[doc = "PARAM4, see MAV_CMD enum"]
20464 pub param4: f32,
20465 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
20466 pub x: f32,
20467 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
20468 pub y: f32,
20469 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
20470 pub z: f32,
20471 #[doc = "Sequence"]
20472 pub seq: u16,
20473 #[doc = "The scheduled action for the waypoint."]
20474 pub command: MavCmd,
20475 #[doc = "System ID"]
20476 pub target_system: u8,
20477 #[doc = "Component ID"]
20478 pub target_component: u8,
20479 #[doc = "The coordinate system of the waypoint."]
20480 pub frame: MavFrame,
20481 #[doc = "false:0, true:1"]
20482 pub current: u8,
20483 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
20484 pub autocontinue: u8,
20485 #[doc = "Mission type."]
20486 #[cfg_attr(feature = "serde", serde(default))]
20487 pub mission_type: MavMissionType,
20488}
20489impl MISSION_ITEM_DATA {
20490 pub const ENCODED_LEN: usize = 38usize;
20491 pub const DEFAULT: Self = Self {
20492 param1: 0.0_f32,
20493 param2: 0.0_f32,
20494 param3: 0.0_f32,
20495 param4: 0.0_f32,
20496 x: 0.0_f32,
20497 y: 0.0_f32,
20498 z: 0.0_f32,
20499 seq: 0_u16,
20500 command: MavCmd::DEFAULT,
20501 target_system: 0_u8,
20502 target_component: 0_u8,
20503 frame: MavFrame::DEFAULT,
20504 current: 0_u8,
20505 autocontinue: 0_u8,
20506 mission_type: MavMissionType::DEFAULT,
20507 };
20508 #[cfg(feature = "arbitrary")]
20509 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20510 use arbitrary::{Arbitrary, Unstructured};
20511 let mut buf = [0u8; 1024];
20512 rng.fill_bytes(&mut buf);
20513 let mut unstructured = Unstructured::new(&buf);
20514 Self::arbitrary(&mut unstructured).unwrap_or_default()
20515 }
20516}
20517impl Default for MISSION_ITEM_DATA {
20518 fn default() -> Self {
20519 Self::DEFAULT.clone()
20520 }
20521}
20522impl MessageData for MISSION_ITEM_DATA {
20523 type Message = MavMessage;
20524 const ID: u32 = 39u32;
20525 const NAME: &'static str = "MISSION_ITEM";
20526 const EXTRA_CRC: u8 = 254u8;
20527 const ENCODED_LEN: usize = 38usize;
20528 fn deser(
20529 _version: MavlinkVersion,
20530 __input: &[u8],
20531 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20532 let avail_len = __input.len();
20533 let mut payload_buf = [0; Self::ENCODED_LEN];
20534 let mut buf = if avail_len < Self::ENCODED_LEN {
20535 payload_buf[0..avail_len].copy_from_slice(__input);
20536 Bytes::new(&payload_buf)
20537 } else {
20538 Bytes::new(__input)
20539 };
20540 let mut __struct = Self::default();
20541 __struct.param1 = buf.get_f32_le()?;
20542 __struct.param2 = buf.get_f32_le()?;
20543 __struct.param3 = buf.get_f32_le()?;
20544 __struct.param4 = buf.get_f32_le()?;
20545 __struct.x = buf.get_f32_le()?;
20546 __struct.y = buf.get_f32_le()?;
20547 __struct.z = buf.get_f32_le()?;
20548 __struct.seq = buf.get_u16_le()?;
20549 let tmp = buf.get_u16_le()?;
20550 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
20551 ::mavlink_core::error::ParserError::InvalidEnum {
20552 enum_type: "MavCmd",
20553 value: tmp as u64,
20554 },
20555 )?;
20556 __struct.target_system = buf.get_u8()?;
20557 __struct.target_component = buf.get_u8()?;
20558 let tmp = buf.get_u8()?;
20559 __struct.frame =
20560 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20561 enum_type: "MavFrame",
20562 value: tmp as u64,
20563 })?;
20564 __struct.current = buf.get_u8()?;
20565 __struct.autocontinue = buf.get_u8()?;
20566 let tmp = buf.get_u8()?;
20567 __struct.mission_type =
20568 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20569 enum_type: "MavMissionType",
20570 value: tmp as u64,
20571 })?;
20572 Ok(__struct)
20573 }
20574 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20575 let mut __tmp = BytesMut::new(bytes);
20576 #[allow(clippy::absurd_extreme_comparisons)]
20577 #[allow(unused_comparisons)]
20578 if __tmp.remaining() < Self::ENCODED_LEN {
20579 panic!(
20580 "buffer is too small (need {} bytes, but got {})",
20581 Self::ENCODED_LEN,
20582 __tmp.remaining(),
20583 )
20584 }
20585 __tmp.put_f32_le(self.param1);
20586 __tmp.put_f32_le(self.param2);
20587 __tmp.put_f32_le(self.param3);
20588 __tmp.put_f32_le(self.param4);
20589 __tmp.put_f32_le(self.x);
20590 __tmp.put_f32_le(self.y);
20591 __tmp.put_f32_le(self.z);
20592 __tmp.put_u16_le(self.seq);
20593 __tmp.put_u16_le(self.command as u16);
20594 __tmp.put_u8(self.target_system);
20595 __tmp.put_u8(self.target_component);
20596 __tmp.put_u8(self.frame as u8);
20597 __tmp.put_u8(self.current);
20598 __tmp.put_u8(self.autocontinue);
20599 if matches!(version, MavlinkVersion::V2) {
20600 __tmp.put_u8(self.mission_type as u8);
20601 let len = __tmp.len();
20602 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20603 } else {
20604 __tmp.len()
20605 }
20606 }
20607}
20608#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
20609#[doc = ""]
20610#[doc = "ID: 73"]
20611#[derive(Debug, Clone, PartialEq)]
20612#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20613#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20614#[cfg_attr(feature = "ts", derive(TS))]
20615#[cfg_attr(feature = "ts", ts(export))]
20616pub struct MISSION_ITEM_INT_DATA {
20617 #[doc = "PARAM1, see MAV_CMD enum"]
20618 pub param1: f32,
20619 #[doc = "PARAM2, see MAV_CMD enum"]
20620 pub param2: f32,
20621 #[doc = "PARAM3, see MAV_CMD enum"]
20622 pub param3: f32,
20623 #[doc = "PARAM4, see MAV_CMD enum"]
20624 pub param4: f32,
20625 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
20626 pub x: i32,
20627 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
20628 pub y: i32,
20629 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
20630 pub z: f32,
20631 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
20632 pub seq: u16,
20633 #[doc = "The scheduled action for the waypoint."]
20634 pub command: MavCmd,
20635 #[doc = "System ID"]
20636 pub target_system: u8,
20637 #[doc = "Component ID"]
20638 pub target_component: u8,
20639 #[doc = "The coordinate system of the waypoint."]
20640 pub frame: MavFrame,
20641 #[doc = "false:0, true:1"]
20642 pub current: u8,
20643 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
20644 pub autocontinue: u8,
20645 #[doc = "Mission type."]
20646 #[cfg_attr(feature = "serde", serde(default))]
20647 pub mission_type: MavMissionType,
20648}
20649impl MISSION_ITEM_INT_DATA {
20650 pub const ENCODED_LEN: usize = 38usize;
20651 pub const DEFAULT: Self = Self {
20652 param1: 0.0_f32,
20653 param2: 0.0_f32,
20654 param3: 0.0_f32,
20655 param4: 0.0_f32,
20656 x: 0_i32,
20657 y: 0_i32,
20658 z: 0.0_f32,
20659 seq: 0_u16,
20660 command: MavCmd::DEFAULT,
20661 target_system: 0_u8,
20662 target_component: 0_u8,
20663 frame: MavFrame::DEFAULT,
20664 current: 0_u8,
20665 autocontinue: 0_u8,
20666 mission_type: MavMissionType::DEFAULT,
20667 };
20668 #[cfg(feature = "arbitrary")]
20669 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20670 use arbitrary::{Arbitrary, Unstructured};
20671 let mut buf = [0u8; 1024];
20672 rng.fill_bytes(&mut buf);
20673 let mut unstructured = Unstructured::new(&buf);
20674 Self::arbitrary(&mut unstructured).unwrap_or_default()
20675 }
20676}
20677impl Default for MISSION_ITEM_INT_DATA {
20678 fn default() -> Self {
20679 Self::DEFAULT.clone()
20680 }
20681}
20682impl MessageData for MISSION_ITEM_INT_DATA {
20683 type Message = MavMessage;
20684 const ID: u32 = 73u32;
20685 const NAME: &'static str = "MISSION_ITEM_INT";
20686 const EXTRA_CRC: u8 = 38u8;
20687 const ENCODED_LEN: usize = 38usize;
20688 fn deser(
20689 _version: MavlinkVersion,
20690 __input: &[u8],
20691 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20692 let avail_len = __input.len();
20693 let mut payload_buf = [0; Self::ENCODED_LEN];
20694 let mut buf = if avail_len < Self::ENCODED_LEN {
20695 payload_buf[0..avail_len].copy_from_slice(__input);
20696 Bytes::new(&payload_buf)
20697 } else {
20698 Bytes::new(__input)
20699 };
20700 let mut __struct = Self::default();
20701 __struct.param1 = buf.get_f32_le()?;
20702 __struct.param2 = buf.get_f32_le()?;
20703 __struct.param3 = buf.get_f32_le()?;
20704 __struct.param4 = buf.get_f32_le()?;
20705 __struct.x = buf.get_i32_le()?;
20706 __struct.y = buf.get_i32_le()?;
20707 __struct.z = buf.get_f32_le()?;
20708 __struct.seq = buf.get_u16_le()?;
20709 let tmp = buf.get_u16_le()?;
20710 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
20711 ::mavlink_core::error::ParserError::InvalidEnum {
20712 enum_type: "MavCmd",
20713 value: tmp as u64,
20714 },
20715 )?;
20716 __struct.target_system = buf.get_u8()?;
20717 __struct.target_component = buf.get_u8()?;
20718 let tmp = buf.get_u8()?;
20719 __struct.frame =
20720 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20721 enum_type: "MavFrame",
20722 value: tmp as u64,
20723 })?;
20724 __struct.current = buf.get_u8()?;
20725 __struct.autocontinue = buf.get_u8()?;
20726 let tmp = buf.get_u8()?;
20727 __struct.mission_type =
20728 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20729 enum_type: "MavMissionType",
20730 value: tmp as u64,
20731 })?;
20732 Ok(__struct)
20733 }
20734 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20735 let mut __tmp = BytesMut::new(bytes);
20736 #[allow(clippy::absurd_extreme_comparisons)]
20737 #[allow(unused_comparisons)]
20738 if __tmp.remaining() < Self::ENCODED_LEN {
20739 panic!(
20740 "buffer is too small (need {} bytes, but got {})",
20741 Self::ENCODED_LEN,
20742 __tmp.remaining(),
20743 )
20744 }
20745 __tmp.put_f32_le(self.param1);
20746 __tmp.put_f32_le(self.param2);
20747 __tmp.put_f32_le(self.param3);
20748 __tmp.put_f32_le(self.param4);
20749 __tmp.put_i32_le(self.x);
20750 __tmp.put_i32_le(self.y);
20751 __tmp.put_f32_le(self.z);
20752 __tmp.put_u16_le(self.seq);
20753 __tmp.put_u16_le(self.command as u16);
20754 __tmp.put_u8(self.target_system);
20755 __tmp.put_u8(self.target_component);
20756 __tmp.put_u8(self.frame as u8);
20757 __tmp.put_u8(self.current);
20758 __tmp.put_u8(self.autocontinue);
20759 if matches!(version, MavlinkVersion::V2) {
20760 __tmp.put_u8(self.mission_type as u8);
20761 let len = __tmp.len();
20762 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20763 } else {
20764 __tmp.len()
20765 }
20766 }
20767}
20768#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
20769#[doc = ""]
20770#[doc = "ID: 46"]
20771#[derive(Debug, Clone, PartialEq)]
20772#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20773#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20774#[cfg_attr(feature = "ts", derive(TS))]
20775#[cfg_attr(feature = "ts", ts(export))]
20776pub struct MISSION_ITEM_REACHED_DATA {
20777 #[doc = "Sequence"]
20778 pub seq: u16,
20779}
20780impl MISSION_ITEM_REACHED_DATA {
20781 pub const ENCODED_LEN: usize = 2usize;
20782 pub const DEFAULT: Self = Self { seq: 0_u16 };
20783 #[cfg(feature = "arbitrary")]
20784 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20785 use arbitrary::{Arbitrary, Unstructured};
20786 let mut buf = [0u8; 1024];
20787 rng.fill_bytes(&mut buf);
20788 let mut unstructured = Unstructured::new(&buf);
20789 Self::arbitrary(&mut unstructured).unwrap_or_default()
20790 }
20791}
20792impl Default for MISSION_ITEM_REACHED_DATA {
20793 fn default() -> Self {
20794 Self::DEFAULT.clone()
20795 }
20796}
20797impl MessageData for MISSION_ITEM_REACHED_DATA {
20798 type Message = MavMessage;
20799 const ID: u32 = 46u32;
20800 const NAME: &'static str = "MISSION_ITEM_REACHED";
20801 const EXTRA_CRC: u8 = 11u8;
20802 const ENCODED_LEN: usize = 2usize;
20803 fn deser(
20804 _version: MavlinkVersion,
20805 __input: &[u8],
20806 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20807 let avail_len = __input.len();
20808 let mut payload_buf = [0; Self::ENCODED_LEN];
20809 let mut buf = if avail_len < Self::ENCODED_LEN {
20810 payload_buf[0..avail_len].copy_from_slice(__input);
20811 Bytes::new(&payload_buf)
20812 } else {
20813 Bytes::new(__input)
20814 };
20815 let mut __struct = Self::default();
20816 __struct.seq = buf.get_u16_le()?;
20817 Ok(__struct)
20818 }
20819 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20820 let mut __tmp = BytesMut::new(bytes);
20821 #[allow(clippy::absurd_extreme_comparisons)]
20822 #[allow(unused_comparisons)]
20823 if __tmp.remaining() < Self::ENCODED_LEN {
20824 panic!(
20825 "buffer is too small (need {} bytes, but got {})",
20826 Self::ENCODED_LEN,
20827 __tmp.remaining(),
20828 )
20829 }
20830 __tmp.put_u16_le(self.seq);
20831 if matches!(version, MavlinkVersion::V2) {
20832 let len = __tmp.len();
20833 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20834 } else {
20835 __tmp.len()
20836 }
20837 }
20838}
20839#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
20840#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
20841#[doc = ""]
20842#[doc = "ID: 40"]
20843#[derive(Debug, Clone, PartialEq)]
20844#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20845#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20846#[cfg_attr(feature = "ts", derive(TS))]
20847#[cfg_attr(feature = "ts", ts(export))]
20848pub struct MISSION_REQUEST_DATA {
20849 #[doc = "Sequence"]
20850 pub seq: u16,
20851 #[doc = "System ID"]
20852 pub target_system: u8,
20853 #[doc = "Component ID"]
20854 pub target_component: u8,
20855 #[doc = "Mission type."]
20856 #[cfg_attr(feature = "serde", serde(default))]
20857 pub mission_type: MavMissionType,
20858}
20859impl MISSION_REQUEST_DATA {
20860 pub const ENCODED_LEN: usize = 5usize;
20861 pub const DEFAULT: Self = Self {
20862 seq: 0_u16,
20863 target_system: 0_u8,
20864 target_component: 0_u8,
20865 mission_type: MavMissionType::DEFAULT,
20866 };
20867 #[cfg(feature = "arbitrary")]
20868 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20869 use arbitrary::{Arbitrary, Unstructured};
20870 let mut buf = [0u8; 1024];
20871 rng.fill_bytes(&mut buf);
20872 let mut unstructured = Unstructured::new(&buf);
20873 Self::arbitrary(&mut unstructured).unwrap_or_default()
20874 }
20875}
20876impl Default for MISSION_REQUEST_DATA {
20877 fn default() -> Self {
20878 Self::DEFAULT.clone()
20879 }
20880}
20881impl MessageData for MISSION_REQUEST_DATA {
20882 type Message = MavMessage;
20883 const ID: u32 = 40u32;
20884 const NAME: &'static str = "MISSION_REQUEST";
20885 const EXTRA_CRC: u8 = 230u8;
20886 const ENCODED_LEN: usize = 5usize;
20887 fn deser(
20888 _version: MavlinkVersion,
20889 __input: &[u8],
20890 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20891 let avail_len = __input.len();
20892 let mut payload_buf = [0; Self::ENCODED_LEN];
20893 let mut buf = if avail_len < Self::ENCODED_LEN {
20894 payload_buf[0..avail_len].copy_from_slice(__input);
20895 Bytes::new(&payload_buf)
20896 } else {
20897 Bytes::new(__input)
20898 };
20899 let mut __struct = Self::default();
20900 __struct.seq = buf.get_u16_le()?;
20901 __struct.target_system = buf.get_u8()?;
20902 __struct.target_component = buf.get_u8()?;
20903 let tmp = buf.get_u8()?;
20904 __struct.mission_type =
20905 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20906 enum_type: "MavMissionType",
20907 value: tmp as u64,
20908 })?;
20909 Ok(__struct)
20910 }
20911 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20912 let mut __tmp = BytesMut::new(bytes);
20913 #[allow(clippy::absurd_extreme_comparisons)]
20914 #[allow(unused_comparisons)]
20915 if __tmp.remaining() < Self::ENCODED_LEN {
20916 panic!(
20917 "buffer is too small (need {} bytes, but got {})",
20918 Self::ENCODED_LEN,
20919 __tmp.remaining(),
20920 )
20921 }
20922 __tmp.put_u16_le(self.seq);
20923 __tmp.put_u8(self.target_system);
20924 __tmp.put_u8(self.target_component);
20925 if matches!(version, MavlinkVersion::V2) {
20926 __tmp.put_u8(self.mission_type as u8);
20927 let len = __tmp.len();
20928 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20929 } else {
20930 __tmp.len()
20931 }
20932 }
20933}
20934#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
20935#[doc = ""]
20936#[doc = "ID: 51"]
20937#[derive(Debug, Clone, PartialEq)]
20938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20939#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20940#[cfg_attr(feature = "ts", derive(TS))]
20941#[cfg_attr(feature = "ts", ts(export))]
20942pub struct MISSION_REQUEST_INT_DATA {
20943 #[doc = "Sequence"]
20944 pub seq: u16,
20945 #[doc = "System ID"]
20946 pub target_system: u8,
20947 #[doc = "Component ID"]
20948 pub target_component: u8,
20949 #[doc = "Mission type."]
20950 #[cfg_attr(feature = "serde", serde(default))]
20951 pub mission_type: MavMissionType,
20952}
20953impl MISSION_REQUEST_INT_DATA {
20954 pub const ENCODED_LEN: usize = 5usize;
20955 pub const DEFAULT: Self = Self {
20956 seq: 0_u16,
20957 target_system: 0_u8,
20958 target_component: 0_u8,
20959 mission_type: MavMissionType::DEFAULT,
20960 };
20961 #[cfg(feature = "arbitrary")]
20962 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20963 use arbitrary::{Arbitrary, Unstructured};
20964 let mut buf = [0u8; 1024];
20965 rng.fill_bytes(&mut buf);
20966 let mut unstructured = Unstructured::new(&buf);
20967 Self::arbitrary(&mut unstructured).unwrap_or_default()
20968 }
20969}
20970impl Default for MISSION_REQUEST_INT_DATA {
20971 fn default() -> Self {
20972 Self::DEFAULT.clone()
20973 }
20974}
20975impl MessageData for MISSION_REQUEST_INT_DATA {
20976 type Message = MavMessage;
20977 const ID: u32 = 51u32;
20978 const NAME: &'static str = "MISSION_REQUEST_INT";
20979 const EXTRA_CRC: u8 = 196u8;
20980 const ENCODED_LEN: usize = 5usize;
20981 fn deser(
20982 _version: MavlinkVersion,
20983 __input: &[u8],
20984 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20985 let avail_len = __input.len();
20986 let mut payload_buf = [0; Self::ENCODED_LEN];
20987 let mut buf = if avail_len < Self::ENCODED_LEN {
20988 payload_buf[0..avail_len].copy_from_slice(__input);
20989 Bytes::new(&payload_buf)
20990 } else {
20991 Bytes::new(__input)
20992 };
20993 let mut __struct = Self::default();
20994 __struct.seq = buf.get_u16_le()?;
20995 __struct.target_system = buf.get_u8()?;
20996 __struct.target_component = buf.get_u8()?;
20997 let tmp = buf.get_u8()?;
20998 __struct.mission_type =
20999 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21000 enum_type: "MavMissionType",
21001 value: tmp as u64,
21002 })?;
21003 Ok(__struct)
21004 }
21005 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21006 let mut __tmp = BytesMut::new(bytes);
21007 #[allow(clippy::absurd_extreme_comparisons)]
21008 #[allow(unused_comparisons)]
21009 if __tmp.remaining() < Self::ENCODED_LEN {
21010 panic!(
21011 "buffer is too small (need {} bytes, but got {})",
21012 Self::ENCODED_LEN,
21013 __tmp.remaining(),
21014 )
21015 }
21016 __tmp.put_u16_le(self.seq);
21017 __tmp.put_u8(self.target_system);
21018 __tmp.put_u8(self.target_component);
21019 if matches!(version, MavlinkVersion::V2) {
21020 __tmp.put_u8(self.mission_type as u8);
21021 let len = __tmp.len();
21022 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21023 } else {
21024 __tmp.len()
21025 }
21026 }
21027}
21028#[doc = "Request the overall list of mission items from the system/component."]
21029#[doc = ""]
21030#[doc = "ID: 43"]
21031#[derive(Debug, Clone, PartialEq)]
21032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21033#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21034#[cfg_attr(feature = "ts", derive(TS))]
21035#[cfg_attr(feature = "ts", ts(export))]
21036pub struct MISSION_REQUEST_LIST_DATA {
21037 #[doc = "System ID"]
21038 pub target_system: u8,
21039 #[doc = "Component ID"]
21040 pub target_component: u8,
21041 #[doc = "Mission type."]
21042 #[cfg_attr(feature = "serde", serde(default))]
21043 pub mission_type: MavMissionType,
21044}
21045impl MISSION_REQUEST_LIST_DATA {
21046 pub const ENCODED_LEN: usize = 3usize;
21047 pub const DEFAULT: Self = Self {
21048 target_system: 0_u8,
21049 target_component: 0_u8,
21050 mission_type: MavMissionType::DEFAULT,
21051 };
21052 #[cfg(feature = "arbitrary")]
21053 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21054 use arbitrary::{Arbitrary, Unstructured};
21055 let mut buf = [0u8; 1024];
21056 rng.fill_bytes(&mut buf);
21057 let mut unstructured = Unstructured::new(&buf);
21058 Self::arbitrary(&mut unstructured).unwrap_or_default()
21059 }
21060}
21061impl Default for MISSION_REQUEST_LIST_DATA {
21062 fn default() -> Self {
21063 Self::DEFAULT.clone()
21064 }
21065}
21066impl MessageData for MISSION_REQUEST_LIST_DATA {
21067 type Message = MavMessage;
21068 const ID: u32 = 43u32;
21069 const NAME: &'static str = "MISSION_REQUEST_LIST";
21070 const EXTRA_CRC: u8 = 132u8;
21071 const ENCODED_LEN: usize = 3usize;
21072 fn deser(
21073 _version: MavlinkVersion,
21074 __input: &[u8],
21075 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21076 let avail_len = __input.len();
21077 let mut payload_buf = [0; Self::ENCODED_LEN];
21078 let mut buf = if avail_len < Self::ENCODED_LEN {
21079 payload_buf[0..avail_len].copy_from_slice(__input);
21080 Bytes::new(&payload_buf)
21081 } else {
21082 Bytes::new(__input)
21083 };
21084 let mut __struct = Self::default();
21085 __struct.target_system = buf.get_u8()?;
21086 __struct.target_component = buf.get_u8()?;
21087 let tmp = buf.get_u8()?;
21088 __struct.mission_type =
21089 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21090 enum_type: "MavMissionType",
21091 value: tmp as u64,
21092 })?;
21093 Ok(__struct)
21094 }
21095 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21096 let mut __tmp = BytesMut::new(bytes);
21097 #[allow(clippy::absurd_extreme_comparisons)]
21098 #[allow(unused_comparisons)]
21099 if __tmp.remaining() < Self::ENCODED_LEN {
21100 panic!(
21101 "buffer is too small (need {} bytes, but got {})",
21102 Self::ENCODED_LEN,
21103 __tmp.remaining(),
21104 )
21105 }
21106 __tmp.put_u8(self.target_system);
21107 __tmp.put_u8(self.target_component);
21108 if matches!(version, MavlinkVersion::V2) {
21109 __tmp.put_u8(self.mission_type as u8);
21110 let len = __tmp.len();
21111 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21112 } else {
21113 __tmp.len()
21114 }
21115 }
21116}
21117#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
21118#[doc = ""]
21119#[doc = "ID: 37"]
21120#[derive(Debug, Clone, PartialEq)]
21121#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21122#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21123#[cfg_attr(feature = "ts", derive(TS))]
21124#[cfg_attr(feature = "ts", ts(export))]
21125pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
21126 #[doc = "Start index"]
21127 pub start_index: i16,
21128 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
21129 pub end_index: i16,
21130 #[doc = "System ID"]
21131 pub target_system: u8,
21132 #[doc = "Component ID"]
21133 pub target_component: u8,
21134 #[doc = "Mission type."]
21135 #[cfg_attr(feature = "serde", serde(default))]
21136 pub mission_type: MavMissionType,
21137}
21138impl MISSION_REQUEST_PARTIAL_LIST_DATA {
21139 pub const ENCODED_LEN: usize = 7usize;
21140 pub const DEFAULT: Self = Self {
21141 start_index: 0_i16,
21142 end_index: 0_i16,
21143 target_system: 0_u8,
21144 target_component: 0_u8,
21145 mission_type: MavMissionType::DEFAULT,
21146 };
21147 #[cfg(feature = "arbitrary")]
21148 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21149 use arbitrary::{Arbitrary, Unstructured};
21150 let mut buf = [0u8; 1024];
21151 rng.fill_bytes(&mut buf);
21152 let mut unstructured = Unstructured::new(&buf);
21153 Self::arbitrary(&mut unstructured).unwrap_or_default()
21154 }
21155}
21156impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
21157 fn default() -> Self {
21158 Self::DEFAULT.clone()
21159 }
21160}
21161impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
21162 type Message = MavMessage;
21163 const ID: u32 = 37u32;
21164 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
21165 const EXTRA_CRC: u8 = 212u8;
21166 const ENCODED_LEN: usize = 7usize;
21167 fn deser(
21168 _version: MavlinkVersion,
21169 __input: &[u8],
21170 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21171 let avail_len = __input.len();
21172 let mut payload_buf = [0; Self::ENCODED_LEN];
21173 let mut buf = if avail_len < Self::ENCODED_LEN {
21174 payload_buf[0..avail_len].copy_from_slice(__input);
21175 Bytes::new(&payload_buf)
21176 } else {
21177 Bytes::new(__input)
21178 };
21179 let mut __struct = Self::default();
21180 __struct.start_index = buf.get_i16_le()?;
21181 __struct.end_index = buf.get_i16_le()?;
21182 __struct.target_system = buf.get_u8()?;
21183 __struct.target_component = buf.get_u8()?;
21184 let tmp = buf.get_u8()?;
21185 __struct.mission_type =
21186 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21187 enum_type: "MavMissionType",
21188 value: tmp as u64,
21189 })?;
21190 Ok(__struct)
21191 }
21192 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21193 let mut __tmp = BytesMut::new(bytes);
21194 #[allow(clippy::absurd_extreme_comparisons)]
21195 #[allow(unused_comparisons)]
21196 if __tmp.remaining() < Self::ENCODED_LEN {
21197 panic!(
21198 "buffer is too small (need {} bytes, but got {})",
21199 Self::ENCODED_LEN,
21200 __tmp.remaining(),
21201 )
21202 }
21203 __tmp.put_i16_le(self.start_index);
21204 __tmp.put_i16_le(self.end_index);
21205 __tmp.put_u8(self.target_system);
21206 __tmp.put_u8(self.target_component);
21207 if matches!(version, MavlinkVersion::V2) {
21208 __tmp.put_u8(self.mission_type as u8);
21209 let len = __tmp.len();
21210 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21211 } else {
21212 __tmp.len()
21213 }
21214 }
21215}
21216#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
21217#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
21218#[doc = ""]
21219#[doc = "ID: 41"]
21220#[derive(Debug, Clone, PartialEq)]
21221#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21222#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21223#[cfg_attr(feature = "ts", derive(TS))]
21224#[cfg_attr(feature = "ts", ts(export))]
21225pub struct MISSION_SET_CURRENT_DATA {
21226 #[doc = "Sequence"]
21227 pub seq: u16,
21228 #[doc = "System ID"]
21229 pub target_system: u8,
21230 #[doc = "Component ID"]
21231 pub target_component: u8,
21232}
21233impl MISSION_SET_CURRENT_DATA {
21234 pub const ENCODED_LEN: usize = 4usize;
21235 pub const DEFAULT: Self = Self {
21236 seq: 0_u16,
21237 target_system: 0_u8,
21238 target_component: 0_u8,
21239 };
21240 #[cfg(feature = "arbitrary")]
21241 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21242 use arbitrary::{Arbitrary, Unstructured};
21243 let mut buf = [0u8; 1024];
21244 rng.fill_bytes(&mut buf);
21245 let mut unstructured = Unstructured::new(&buf);
21246 Self::arbitrary(&mut unstructured).unwrap_or_default()
21247 }
21248}
21249impl Default for MISSION_SET_CURRENT_DATA {
21250 fn default() -> Self {
21251 Self::DEFAULT.clone()
21252 }
21253}
21254impl MessageData for MISSION_SET_CURRENT_DATA {
21255 type Message = MavMessage;
21256 const ID: u32 = 41u32;
21257 const NAME: &'static str = "MISSION_SET_CURRENT";
21258 const EXTRA_CRC: u8 = 28u8;
21259 const ENCODED_LEN: usize = 4usize;
21260 fn deser(
21261 _version: MavlinkVersion,
21262 __input: &[u8],
21263 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21264 let avail_len = __input.len();
21265 let mut payload_buf = [0; Self::ENCODED_LEN];
21266 let mut buf = if avail_len < Self::ENCODED_LEN {
21267 payload_buf[0..avail_len].copy_from_slice(__input);
21268 Bytes::new(&payload_buf)
21269 } else {
21270 Bytes::new(__input)
21271 };
21272 let mut __struct = Self::default();
21273 __struct.seq = buf.get_u16_le()?;
21274 __struct.target_system = buf.get_u8()?;
21275 __struct.target_component = buf.get_u8()?;
21276 Ok(__struct)
21277 }
21278 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21279 let mut __tmp = BytesMut::new(bytes);
21280 #[allow(clippy::absurd_extreme_comparisons)]
21281 #[allow(unused_comparisons)]
21282 if __tmp.remaining() < Self::ENCODED_LEN {
21283 panic!(
21284 "buffer is too small (need {} bytes, but got {})",
21285 Self::ENCODED_LEN,
21286 __tmp.remaining(),
21287 )
21288 }
21289 __tmp.put_u16_le(self.seq);
21290 __tmp.put_u8(self.target_system);
21291 __tmp.put_u8(self.target_component);
21292 if matches!(version, MavlinkVersion::V2) {
21293 let len = __tmp.len();
21294 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21295 } else {
21296 __tmp.len()
21297 }
21298 }
21299}
21300#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
21301#[doc = ""]
21302#[doc = "ID: 38"]
21303#[derive(Debug, Clone, PartialEq)]
21304#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21305#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21306#[cfg_attr(feature = "ts", derive(TS))]
21307#[cfg_attr(feature = "ts", ts(export))]
21308pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
21309 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
21310 pub start_index: i16,
21311 #[doc = "End index, equal or greater than start index."]
21312 pub end_index: i16,
21313 #[doc = "System ID"]
21314 pub target_system: u8,
21315 #[doc = "Component ID"]
21316 pub target_component: u8,
21317 #[doc = "Mission type."]
21318 #[cfg_attr(feature = "serde", serde(default))]
21319 pub mission_type: MavMissionType,
21320}
21321impl MISSION_WRITE_PARTIAL_LIST_DATA {
21322 pub const ENCODED_LEN: usize = 7usize;
21323 pub const DEFAULT: Self = Self {
21324 start_index: 0_i16,
21325 end_index: 0_i16,
21326 target_system: 0_u8,
21327 target_component: 0_u8,
21328 mission_type: MavMissionType::DEFAULT,
21329 };
21330 #[cfg(feature = "arbitrary")]
21331 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21332 use arbitrary::{Arbitrary, Unstructured};
21333 let mut buf = [0u8; 1024];
21334 rng.fill_bytes(&mut buf);
21335 let mut unstructured = Unstructured::new(&buf);
21336 Self::arbitrary(&mut unstructured).unwrap_or_default()
21337 }
21338}
21339impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
21340 fn default() -> Self {
21341 Self::DEFAULT.clone()
21342 }
21343}
21344impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
21345 type Message = MavMessage;
21346 const ID: u32 = 38u32;
21347 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
21348 const EXTRA_CRC: u8 = 9u8;
21349 const ENCODED_LEN: usize = 7usize;
21350 fn deser(
21351 _version: MavlinkVersion,
21352 __input: &[u8],
21353 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21354 let avail_len = __input.len();
21355 let mut payload_buf = [0; Self::ENCODED_LEN];
21356 let mut buf = if avail_len < Self::ENCODED_LEN {
21357 payload_buf[0..avail_len].copy_from_slice(__input);
21358 Bytes::new(&payload_buf)
21359 } else {
21360 Bytes::new(__input)
21361 };
21362 let mut __struct = Self::default();
21363 __struct.start_index = buf.get_i16_le()?;
21364 __struct.end_index = buf.get_i16_le()?;
21365 __struct.target_system = buf.get_u8()?;
21366 __struct.target_component = buf.get_u8()?;
21367 let tmp = buf.get_u8()?;
21368 __struct.mission_type =
21369 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21370 enum_type: "MavMissionType",
21371 value: tmp as u64,
21372 })?;
21373 Ok(__struct)
21374 }
21375 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21376 let mut __tmp = BytesMut::new(bytes);
21377 #[allow(clippy::absurd_extreme_comparisons)]
21378 #[allow(unused_comparisons)]
21379 if __tmp.remaining() < Self::ENCODED_LEN {
21380 panic!(
21381 "buffer is too small (need {} bytes, but got {})",
21382 Self::ENCODED_LEN,
21383 __tmp.remaining(),
21384 )
21385 }
21386 __tmp.put_i16_le(self.start_index);
21387 __tmp.put_i16_le(self.end_index);
21388 __tmp.put_u8(self.target_system);
21389 __tmp.put_u8(self.target_component);
21390 if matches!(version, MavlinkVersion::V2) {
21391 __tmp.put_u8(self.mission_type as u8);
21392 let len = __tmp.len();
21393 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21394 } else {
21395 __tmp.len()
21396 }
21397 }
21398}
21399#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
21400#[doc = "Orientation of a mount."]
21401#[doc = ""]
21402#[doc = "ID: 265"]
21403#[derive(Debug, Clone, PartialEq)]
21404#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21405#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21406#[cfg_attr(feature = "ts", derive(TS))]
21407#[cfg_attr(feature = "ts", ts(export))]
21408pub struct MOUNT_ORIENTATION_DATA {
21409 #[doc = "Timestamp (time since system boot)."]
21410 pub time_boot_ms: u32,
21411 #[doc = "Roll in global frame (set to NaN for invalid)."]
21412 pub roll: f32,
21413 #[doc = "Pitch in global frame (set to NaN for invalid)."]
21414 pub pitch: f32,
21415 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
21416 pub yaw: f32,
21417 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
21418 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21419 pub yaw_absolute: f32,
21420}
21421impl MOUNT_ORIENTATION_DATA {
21422 pub const ENCODED_LEN: usize = 20usize;
21423 pub const DEFAULT: Self = Self {
21424 time_boot_ms: 0_u32,
21425 roll: 0.0_f32,
21426 pitch: 0.0_f32,
21427 yaw: 0.0_f32,
21428 yaw_absolute: 0.0_f32,
21429 };
21430 #[cfg(feature = "arbitrary")]
21431 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21432 use arbitrary::{Arbitrary, Unstructured};
21433 let mut buf = [0u8; 1024];
21434 rng.fill_bytes(&mut buf);
21435 let mut unstructured = Unstructured::new(&buf);
21436 Self::arbitrary(&mut unstructured).unwrap_or_default()
21437 }
21438}
21439impl Default for MOUNT_ORIENTATION_DATA {
21440 fn default() -> Self {
21441 Self::DEFAULT.clone()
21442 }
21443}
21444impl MessageData for MOUNT_ORIENTATION_DATA {
21445 type Message = MavMessage;
21446 const ID: u32 = 265u32;
21447 const NAME: &'static str = "MOUNT_ORIENTATION";
21448 const EXTRA_CRC: u8 = 26u8;
21449 const ENCODED_LEN: usize = 20usize;
21450 fn deser(
21451 _version: MavlinkVersion,
21452 __input: &[u8],
21453 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21454 let avail_len = __input.len();
21455 let mut payload_buf = [0; Self::ENCODED_LEN];
21456 let mut buf = if avail_len < Self::ENCODED_LEN {
21457 payload_buf[0..avail_len].copy_from_slice(__input);
21458 Bytes::new(&payload_buf)
21459 } else {
21460 Bytes::new(__input)
21461 };
21462 let mut __struct = Self::default();
21463 __struct.time_boot_ms = buf.get_u32_le()?;
21464 __struct.roll = buf.get_f32_le()?;
21465 __struct.pitch = buf.get_f32_le()?;
21466 __struct.yaw = buf.get_f32_le()?;
21467 __struct.yaw_absolute = buf.get_f32_le()?;
21468 Ok(__struct)
21469 }
21470 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21471 let mut __tmp = BytesMut::new(bytes);
21472 #[allow(clippy::absurd_extreme_comparisons)]
21473 #[allow(unused_comparisons)]
21474 if __tmp.remaining() < Self::ENCODED_LEN {
21475 panic!(
21476 "buffer is too small (need {} bytes, but got {})",
21477 Self::ENCODED_LEN,
21478 __tmp.remaining(),
21479 )
21480 }
21481 __tmp.put_u32_le(self.time_boot_ms);
21482 __tmp.put_f32_le(self.roll);
21483 __tmp.put_f32_le(self.pitch);
21484 __tmp.put_f32_le(self.yaw);
21485 if matches!(version, MavlinkVersion::V2) {
21486 __tmp.put_f32_le(self.yaw_absolute);
21487 let len = __tmp.len();
21488 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21489 } else {
21490 __tmp.len()
21491 }
21492 }
21493}
21494#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
21495#[doc = ""]
21496#[doc = "ID: 251"]
21497#[derive(Debug, Clone, PartialEq)]
21498#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21499#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21500#[cfg_attr(feature = "ts", derive(TS))]
21501#[cfg_attr(feature = "ts", ts(export))]
21502pub struct NAMED_VALUE_FLOAT_DATA {
21503 #[doc = "Timestamp (time since system boot)."]
21504 pub time_boot_ms: u32,
21505 #[doc = "Floating point value"]
21506 pub value: f32,
21507 #[doc = "Name of the debug variable"]
21508 #[cfg_attr(feature = "ts", ts(type = "string"))]
21509 pub name: CharArray<10>,
21510}
21511impl NAMED_VALUE_FLOAT_DATA {
21512 pub const ENCODED_LEN: usize = 18usize;
21513 pub const DEFAULT: Self = Self {
21514 time_boot_ms: 0_u32,
21515 value: 0.0_f32,
21516 name: CharArray::new([0_u8; 10usize]),
21517 };
21518 #[cfg(feature = "arbitrary")]
21519 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21520 use arbitrary::{Arbitrary, Unstructured};
21521 let mut buf = [0u8; 1024];
21522 rng.fill_bytes(&mut buf);
21523 let mut unstructured = Unstructured::new(&buf);
21524 Self::arbitrary(&mut unstructured).unwrap_or_default()
21525 }
21526}
21527impl Default for NAMED_VALUE_FLOAT_DATA {
21528 fn default() -> Self {
21529 Self::DEFAULT.clone()
21530 }
21531}
21532impl MessageData for NAMED_VALUE_FLOAT_DATA {
21533 type Message = MavMessage;
21534 const ID: u32 = 251u32;
21535 const NAME: &'static str = "NAMED_VALUE_FLOAT";
21536 const EXTRA_CRC: u8 = 170u8;
21537 const ENCODED_LEN: usize = 18usize;
21538 fn deser(
21539 _version: MavlinkVersion,
21540 __input: &[u8],
21541 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21542 let avail_len = __input.len();
21543 let mut payload_buf = [0; Self::ENCODED_LEN];
21544 let mut buf = if avail_len < Self::ENCODED_LEN {
21545 payload_buf[0..avail_len].copy_from_slice(__input);
21546 Bytes::new(&payload_buf)
21547 } else {
21548 Bytes::new(__input)
21549 };
21550 let mut __struct = Self::default();
21551 __struct.time_boot_ms = buf.get_u32_le()?;
21552 __struct.value = buf.get_f32_le()?;
21553 let mut tmp = [0_u8; 10usize];
21554 for v in &mut tmp {
21555 *v = buf.get_u8()?;
21556 }
21557 __struct.name = CharArray::new(tmp);
21558 Ok(__struct)
21559 }
21560 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21561 let mut __tmp = BytesMut::new(bytes);
21562 #[allow(clippy::absurd_extreme_comparisons)]
21563 #[allow(unused_comparisons)]
21564 if __tmp.remaining() < Self::ENCODED_LEN {
21565 panic!(
21566 "buffer is too small (need {} bytes, but got {})",
21567 Self::ENCODED_LEN,
21568 __tmp.remaining(),
21569 )
21570 }
21571 __tmp.put_u32_le(self.time_boot_ms);
21572 __tmp.put_f32_le(self.value);
21573 for val in &self.name {
21574 __tmp.put_u8(*val);
21575 }
21576 if matches!(version, MavlinkVersion::V2) {
21577 let len = __tmp.len();
21578 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21579 } else {
21580 __tmp.len()
21581 }
21582 }
21583}
21584#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
21585#[doc = ""]
21586#[doc = "ID: 252"]
21587#[derive(Debug, Clone, PartialEq)]
21588#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21589#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21590#[cfg_attr(feature = "ts", derive(TS))]
21591#[cfg_attr(feature = "ts", ts(export))]
21592pub struct NAMED_VALUE_INT_DATA {
21593 #[doc = "Timestamp (time since system boot)."]
21594 pub time_boot_ms: u32,
21595 #[doc = "Signed integer value"]
21596 pub value: i32,
21597 #[doc = "Name of the debug variable"]
21598 #[cfg_attr(feature = "ts", ts(type = "string"))]
21599 pub name: CharArray<10>,
21600}
21601impl NAMED_VALUE_INT_DATA {
21602 pub const ENCODED_LEN: usize = 18usize;
21603 pub const DEFAULT: Self = Self {
21604 time_boot_ms: 0_u32,
21605 value: 0_i32,
21606 name: CharArray::new([0_u8; 10usize]),
21607 };
21608 #[cfg(feature = "arbitrary")]
21609 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21610 use arbitrary::{Arbitrary, Unstructured};
21611 let mut buf = [0u8; 1024];
21612 rng.fill_bytes(&mut buf);
21613 let mut unstructured = Unstructured::new(&buf);
21614 Self::arbitrary(&mut unstructured).unwrap_or_default()
21615 }
21616}
21617impl Default for NAMED_VALUE_INT_DATA {
21618 fn default() -> Self {
21619 Self::DEFAULT.clone()
21620 }
21621}
21622impl MessageData for NAMED_VALUE_INT_DATA {
21623 type Message = MavMessage;
21624 const ID: u32 = 252u32;
21625 const NAME: &'static str = "NAMED_VALUE_INT";
21626 const EXTRA_CRC: u8 = 44u8;
21627 const ENCODED_LEN: usize = 18usize;
21628 fn deser(
21629 _version: MavlinkVersion,
21630 __input: &[u8],
21631 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21632 let avail_len = __input.len();
21633 let mut payload_buf = [0; Self::ENCODED_LEN];
21634 let mut buf = if avail_len < Self::ENCODED_LEN {
21635 payload_buf[0..avail_len].copy_from_slice(__input);
21636 Bytes::new(&payload_buf)
21637 } else {
21638 Bytes::new(__input)
21639 };
21640 let mut __struct = Self::default();
21641 __struct.time_boot_ms = buf.get_u32_le()?;
21642 __struct.value = buf.get_i32_le()?;
21643 let mut tmp = [0_u8; 10usize];
21644 for v in &mut tmp {
21645 *v = buf.get_u8()?;
21646 }
21647 __struct.name = CharArray::new(tmp);
21648 Ok(__struct)
21649 }
21650 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21651 let mut __tmp = BytesMut::new(bytes);
21652 #[allow(clippy::absurd_extreme_comparisons)]
21653 #[allow(unused_comparisons)]
21654 if __tmp.remaining() < Self::ENCODED_LEN {
21655 panic!(
21656 "buffer is too small (need {} bytes, but got {})",
21657 Self::ENCODED_LEN,
21658 __tmp.remaining(),
21659 )
21660 }
21661 __tmp.put_u32_le(self.time_boot_ms);
21662 __tmp.put_i32_le(self.value);
21663 for val in &self.name {
21664 __tmp.put_u8(*val);
21665 }
21666 if matches!(version, MavlinkVersion::V2) {
21667 let len = __tmp.len();
21668 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21669 } else {
21670 __tmp.len()
21671 }
21672 }
21673}
21674#[doc = "The state of the navigation and position controller."]
21675#[doc = ""]
21676#[doc = "ID: 62"]
21677#[derive(Debug, Clone, PartialEq)]
21678#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21679#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21680#[cfg_attr(feature = "ts", derive(TS))]
21681#[cfg_attr(feature = "ts", ts(export))]
21682pub struct NAV_CONTROLLER_OUTPUT_DATA {
21683 #[doc = "Current desired roll"]
21684 pub nav_roll: f32,
21685 #[doc = "Current desired pitch"]
21686 pub nav_pitch: f32,
21687 #[doc = "Current altitude error"]
21688 pub alt_error: f32,
21689 #[doc = "Current airspeed error"]
21690 pub aspd_error: f32,
21691 #[doc = "Current crosstrack error on x-y plane"]
21692 pub xtrack_error: f32,
21693 #[doc = "Current desired heading"]
21694 pub nav_bearing: i16,
21695 #[doc = "Bearing to current waypoint/target"]
21696 pub target_bearing: i16,
21697 #[doc = "Distance to active waypoint"]
21698 pub wp_dist: u16,
21699}
21700impl NAV_CONTROLLER_OUTPUT_DATA {
21701 pub const ENCODED_LEN: usize = 26usize;
21702 pub const DEFAULT: Self = Self {
21703 nav_roll: 0.0_f32,
21704 nav_pitch: 0.0_f32,
21705 alt_error: 0.0_f32,
21706 aspd_error: 0.0_f32,
21707 xtrack_error: 0.0_f32,
21708 nav_bearing: 0_i16,
21709 target_bearing: 0_i16,
21710 wp_dist: 0_u16,
21711 };
21712 #[cfg(feature = "arbitrary")]
21713 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21714 use arbitrary::{Arbitrary, Unstructured};
21715 let mut buf = [0u8; 1024];
21716 rng.fill_bytes(&mut buf);
21717 let mut unstructured = Unstructured::new(&buf);
21718 Self::arbitrary(&mut unstructured).unwrap_or_default()
21719 }
21720}
21721impl Default for NAV_CONTROLLER_OUTPUT_DATA {
21722 fn default() -> Self {
21723 Self::DEFAULT.clone()
21724 }
21725}
21726impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
21727 type Message = MavMessage;
21728 const ID: u32 = 62u32;
21729 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
21730 const EXTRA_CRC: u8 = 183u8;
21731 const ENCODED_LEN: usize = 26usize;
21732 fn deser(
21733 _version: MavlinkVersion,
21734 __input: &[u8],
21735 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21736 let avail_len = __input.len();
21737 let mut payload_buf = [0; Self::ENCODED_LEN];
21738 let mut buf = if avail_len < Self::ENCODED_LEN {
21739 payload_buf[0..avail_len].copy_from_slice(__input);
21740 Bytes::new(&payload_buf)
21741 } else {
21742 Bytes::new(__input)
21743 };
21744 let mut __struct = Self::default();
21745 __struct.nav_roll = buf.get_f32_le()?;
21746 __struct.nav_pitch = buf.get_f32_le()?;
21747 __struct.alt_error = buf.get_f32_le()?;
21748 __struct.aspd_error = buf.get_f32_le()?;
21749 __struct.xtrack_error = buf.get_f32_le()?;
21750 __struct.nav_bearing = buf.get_i16_le()?;
21751 __struct.target_bearing = buf.get_i16_le()?;
21752 __struct.wp_dist = buf.get_u16_le()?;
21753 Ok(__struct)
21754 }
21755 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21756 let mut __tmp = BytesMut::new(bytes);
21757 #[allow(clippy::absurd_extreme_comparisons)]
21758 #[allow(unused_comparisons)]
21759 if __tmp.remaining() < Self::ENCODED_LEN {
21760 panic!(
21761 "buffer is too small (need {} bytes, but got {})",
21762 Self::ENCODED_LEN,
21763 __tmp.remaining(),
21764 )
21765 }
21766 __tmp.put_f32_le(self.nav_roll);
21767 __tmp.put_f32_le(self.nav_pitch);
21768 __tmp.put_f32_le(self.alt_error);
21769 __tmp.put_f32_le(self.aspd_error);
21770 __tmp.put_f32_le(self.xtrack_error);
21771 __tmp.put_i16_le(self.nav_bearing);
21772 __tmp.put_i16_le(self.target_bearing);
21773 __tmp.put_u16_le(self.wp_dist);
21774 if matches!(version, MavlinkVersion::V2) {
21775 let len = __tmp.len();
21776 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21777 } else {
21778 __tmp.len()
21779 }
21780 }
21781}
21782#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
21783#[doc = ""]
21784#[doc = "ID: 330"]
21785#[derive(Debug, Clone, PartialEq)]
21786#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21787#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21788#[cfg_attr(feature = "ts", derive(TS))]
21789#[cfg_attr(feature = "ts", ts(export))]
21790pub struct OBSTACLE_DISTANCE_DATA {
21791 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21792 pub time_usec: u64,
21793 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
21794 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21795 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21796 pub distances: [u16; 72],
21797 #[doc = "Minimum distance the sensor can measure."]
21798 pub min_distance: u16,
21799 #[doc = "Maximum distance the sensor can measure."]
21800 pub max_distance: u16,
21801 #[doc = "Class id of the distance sensor type."]
21802 pub sensor_type: MavDistanceSensor,
21803 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
21804 pub increment: u8,
21805 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
21806 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21807 pub increment_f: f32,
21808 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
21809 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21810 pub angle_offset: f32,
21811 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
21812 #[cfg_attr(feature = "serde", serde(default))]
21813 pub frame: MavFrame,
21814}
21815impl OBSTACLE_DISTANCE_DATA {
21816 pub const ENCODED_LEN: usize = 167usize;
21817 pub const DEFAULT: Self = Self {
21818 time_usec: 0_u64,
21819 distances: [0_u16; 72usize],
21820 min_distance: 0_u16,
21821 max_distance: 0_u16,
21822 sensor_type: MavDistanceSensor::DEFAULT,
21823 increment: 0_u8,
21824 increment_f: 0.0_f32,
21825 angle_offset: 0.0_f32,
21826 frame: MavFrame::DEFAULT,
21827 };
21828 #[cfg(feature = "arbitrary")]
21829 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21830 use arbitrary::{Arbitrary, Unstructured};
21831 let mut buf = [0u8; 1024];
21832 rng.fill_bytes(&mut buf);
21833 let mut unstructured = Unstructured::new(&buf);
21834 Self::arbitrary(&mut unstructured).unwrap_or_default()
21835 }
21836}
21837impl Default for OBSTACLE_DISTANCE_DATA {
21838 fn default() -> Self {
21839 Self::DEFAULT.clone()
21840 }
21841}
21842impl MessageData for OBSTACLE_DISTANCE_DATA {
21843 type Message = MavMessage;
21844 const ID: u32 = 330u32;
21845 const NAME: &'static str = "OBSTACLE_DISTANCE";
21846 const EXTRA_CRC: u8 = 23u8;
21847 const ENCODED_LEN: usize = 167usize;
21848 fn deser(
21849 _version: MavlinkVersion,
21850 __input: &[u8],
21851 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21852 let avail_len = __input.len();
21853 let mut payload_buf = [0; Self::ENCODED_LEN];
21854 let mut buf = if avail_len < Self::ENCODED_LEN {
21855 payload_buf[0..avail_len].copy_from_slice(__input);
21856 Bytes::new(&payload_buf)
21857 } else {
21858 Bytes::new(__input)
21859 };
21860 let mut __struct = Self::default();
21861 __struct.time_usec = buf.get_u64_le()?;
21862 for v in &mut __struct.distances {
21863 let val = buf.get_u16_le()?;
21864 *v = val;
21865 }
21866 __struct.min_distance = buf.get_u16_le()?;
21867 __struct.max_distance = buf.get_u16_le()?;
21868 let tmp = buf.get_u8()?;
21869 __struct.sensor_type =
21870 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21871 enum_type: "MavDistanceSensor",
21872 value: tmp as u64,
21873 })?;
21874 __struct.increment = buf.get_u8()?;
21875 __struct.increment_f = buf.get_f32_le()?;
21876 __struct.angle_offset = buf.get_f32_le()?;
21877 let tmp = buf.get_u8()?;
21878 __struct.frame =
21879 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21880 enum_type: "MavFrame",
21881 value: tmp as u64,
21882 })?;
21883 Ok(__struct)
21884 }
21885 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21886 let mut __tmp = BytesMut::new(bytes);
21887 #[allow(clippy::absurd_extreme_comparisons)]
21888 #[allow(unused_comparisons)]
21889 if __tmp.remaining() < Self::ENCODED_LEN {
21890 panic!(
21891 "buffer is too small (need {} bytes, but got {})",
21892 Self::ENCODED_LEN,
21893 __tmp.remaining(),
21894 )
21895 }
21896 __tmp.put_u64_le(self.time_usec);
21897 for val in &self.distances {
21898 __tmp.put_u16_le(*val);
21899 }
21900 __tmp.put_u16_le(self.min_distance);
21901 __tmp.put_u16_le(self.max_distance);
21902 __tmp.put_u8(self.sensor_type as u8);
21903 __tmp.put_u8(self.increment);
21904 if matches!(version, MavlinkVersion::V2) {
21905 __tmp.put_f32_le(self.increment_f);
21906 __tmp.put_f32_le(self.angle_offset);
21907 __tmp.put_u8(self.frame as u8);
21908 let len = __tmp.len();
21909 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21910 } else {
21911 __tmp.len()
21912 }
21913 }
21914}
21915#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
21916#[doc = ""]
21917#[doc = "ID: 331"]
21918#[derive(Debug, Clone, PartialEq)]
21919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21920#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21921#[cfg_attr(feature = "ts", derive(TS))]
21922#[cfg_attr(feature = "ts", ts(export))]
21923pub struct ODOMETRY_DATA {
21924 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21925 pub time_usec: u64,
21926 #[doc = "X Position"]
21927 pub x: f32,
21928 #[doc = "Y Position"]
21929 pub y: f32,
21930 #[doc = "Z Position"]
21931 pub z: f32,
21932 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
21933 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21934 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21935 pub q: [f32; 4],
21936 #[doc = "X linear speed"]
21937 pub vx: f32,
21938 #[doc = "Y linear speed"]
21939 pub vy: f32,
21940 #[doc = "Z linear speed"]
21941 pub vz: f32,
21942 #[doc = "Roll angular speed"]
21943 pub rollspeed: f32,
21944 #[doc = "Pitch angular speed"]
21945 pub pitchspeed: f32,
21946 #[doc = "Yaw angular speed"]
21947 pub yawspeed: f32,
21948 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21949 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21950 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21951 pub pose_covariance: [f32; 21],
21952 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
21953 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21954 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
21955 pub velocity_covariance: [f32; 21],
21956 #[doc = "Coordinate frame of reference for the pose data."]
21957 pub frame_id: MavFrame,
21958 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
21959 pub child_frame_id: MavFrame,
21960 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
21961 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21962 pub reset_counter: u8,
21963 #[doc = "Type of estimator that is providing the odometry."]
21964 #[cfg_attr(feature = "serde", serde(default))]
21965 pub estimator_type: MavEstimatorType,
21966 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
21967 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21968 pub quality: i8,
21969}
21970impl ODOMETRY_DATA {
21971 pub const ENCODED_LEN: usize = 233usize;
21972 pub const DEFAULT: Self = Self {
21973 time_usec: 0_u64,
21974 x: 0.0_f32,
21975 y: 0.0_f32,
21976 z: 0.0_f32,
21977 q: [0.0_f32; 4usize],
21978 vx: 0.0_f32,
21979 vy: 0.0_f32,
21980 vz: 0.0_f32,
21981 rollspeed: 0.0_f32,
21982 pitchspeed: 0.0_f32,
21983 yawspeed: 0.0_f32,
21984 pose_covariance: [0.0_f32; 21usize],
21985 velocity_covariance: [0.0_f32; 21usize],
21986 frame_id: MavFrame::DEFAULT,
21987 child_frame_id: MavFrame::DEFAULT,
21988 reset_counter: 0_u8,
21989 estimator_type: MavEstimatorType::DEFAULT,
21990 quality: 0_i8,
21991 };
21992 #[cfg(feature = "arbitrary")]
21993 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21994 use arbitrary::{Arbitrary, Unstructured};
21995 let mut buf = [0u8; 1024];
21996 rng.fill_bytes(&mut buf);
21997 let mut unstructured = Unstructured::new(&buf);
21998 Self::arbitrary(&mut unstructured).unwrap_or_default()
21999 }
22000}
22001impl Default for ODOMETRY_DATA {
22002 fn default() -> Self {
22003 Self::DEFAULT.clone()
22004 }
22005}
22006impl MessageData for ODOMETRY_DATA {
22007 type Message = MavMessage;
22008 const ID: u32 = 331u32;
22009 const NAME: &'static str = "ODOMETRY";
22010 const EXTRA_CRC: u8 = 91u8;
22011 const ENCODED_LEN: usize = 233usize;
22012 fn deser(
22013 _version: MavlinkVersion,
22014 __input: &[u8],
22015 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22016 let avail_len = __input.len();
22017 let mut payload_buf = [0; Self::ENCODED_LEN];
22018 let mut buf = if avail_len < Self::ENCODED_LEN {
22019 payload_buf[0..avail_len].copy_from_slice(__input);
22020 Bytes::new(&payload_buf)
22021 } else {
22022 Bytes::new(__input)
22023 };
22024 let mut __struct = Self::default();
22025 __struct.time_usec = buf.get_u64_le()?;
22026 __struct.x = buf.get_f32_le()?;
22027 __struct.y = buf.get_f32_le()?;
22028 __struct.z = buf.get_f32_le()?;
22029 for v in &mut __struct.q {
22030 let val = buf.get_f32_le()?;
22031 *v = val;
22032 }
22033 __struct.vx = buf.get_f32_le()?;
22034 __struct.vy = buf.get_f32_le()?;
22035 __struct.vz = buf.get_f32_le()?;
22036 __struct.rollspeed = buf.get_f32_le()?;
22037 __struct.pitchspeed = buf.get_f32_le()?;
22038 __struct.yawspeed = buf.get_f32_le()?;
22039 for v in &mut __struct.pose_covariance {
22040 let val = buf.get_f32_le()?;
22041 *v = val;
22042 }
22043 for v in &mut __struct.velocity_covariance {
22044 let val = buf.get_f32_le()?;
22045 *v = val;
22046 }
22047 let tmp = buf.get_u8()?;
22048 __struct.frame_id =
22049 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22050 enum_type: "MavFrame",
22051 value: tmp as u64,
22052 })?;
22053 let tmp = buf.get_u8()?;
22054 __struct.child_frame_id =
22055 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22056 enum_type: "MavFrame",
22057 value: tmp as u64,
22058 })?;
22059 __struct.reset_counter = buf.get_u8()?;
22060 let tmp = buf.get_u8()?;
22061 __struct.estimator_type =
22062 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22063 enum_type: "MavEstimatorType",
22064 value: tmp as u64,
22065 })?;
22066 __struct.quality = buf.get_i8()?;
22067 Ok(__struct)
22068 }
22069 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22070 let mut __tmp = BytesMut::new(bytes);
22071 #[allow(clippy::absurd_extreme_comparisons)]
22072 #[allow(unused_comparisons)]
22073 if __tmp.remaining() < Self::ENCODED_LEN {
22074 panic!(
22075 "buffer is too small (need {} bytes, but got {})",
22076 Self::ENCODED_LEN,
22077 __tmp.remaining(),
22078 )
22079 }
22080 __tmp.put_u64_le(self.time_usec);
22081 __tmp.put_f32_le(self.x);
22082 __tmp.put_f32_le(self.y);
22083 __tmp.put_f32_le(self.z);
22084 for val in &self.q {
22085 __tmp.put_f32_le(*val);
22086 }
22087 __tmp.put_f32_le(self.vx);
22088 __tmp.put_f32_le(self.vy);
22089 __tmp.put_f32_le(self.vz);
22090 __tmp.put_f32_le(self.rollspeed);
22091 __tmp.put_f32_le(self.pitchspeed);
22092 __tmp.put_f32_le(self.yawspeed);
22093 for val in &self.pose_covariance {
22094 __tmp.put_f32_le(*val);
22095 }
22096 for val in &self.velocity_covariance {
22097 __tmp.put_f32_le(*val);
22098 }
22099 __tmp.put_u8(self.frame_id as u8);
22100 __tmp.put_u8(self.child_frame_id as u8);
22101 if matches!(version, MavlinkVersion::V2) {
22102 __tmp.put_u8(self.reset_counter);
22103 __tmp.put_u8(self.estimator_type as u8);
22104 __tmp.put_i8(self.quality);
22105 let len = __tmp.len();
22106 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22107 } else {
22108 __tmp.len()
22109 }
22110 }
22111}
22112#[doc = "Hardware status sent by an onboard computer."]
22113#[doc = ""]
22114#[doc = "ID: 390"]
22115#[derive(Debug, Clone, PartialEq)]
22116#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22117#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22118#[cfg_attr(feature = "ts", derive(TS))]
22119#[cfg_attr(feature = "ts", ts(export))]
22120pub struct ONBOARD_COMPUTER_STATUS_DATA {
22121 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22122 pub time_usec: u64,
22123 #[doc = "Time since system boot."]
22124 pub uptime: u32,
22125 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
22126 pub ram_usage: u32,
22127 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
22128 pub ram_total: u32,
22129 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
22130 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22131 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22132 pub storage_type: [u32; 4],
22133 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
22134 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22135 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22136 pub storage_usage: [u32; 4],
22137 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
22138 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22139 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22140 pub storage_total: [u32; 4],
22141 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
22142 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22143 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22144 pub link_type: [u32; 6],
22145 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
22146 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22147 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22148 pub link_tx_rate: [u32; 6],
22149 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
22150 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22151 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22152 pub link_rx_rate: [u32; 6],
22153 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
22154 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22155 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22156 pub link_tx_max: [u32; 6],
22157 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
22158 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22159 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22160 pub link_rx_max: [u32; 6],
22161 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
22162 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22163 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22164 pub fan_speed: [i16; 4],
22165 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
22166 pub mavtype: u8,
22167 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
22168 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22169 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22170 pub cpu_cores: [u8; 8],
22171 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
22172 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22173 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22174 pub cpu_combined: [u8; 10],
22175 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
22176 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22177 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22178 pub gpu_cores: [u8; 4],
22179 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
22180 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22181 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22182 pub gpu_combined: [u8; 10],
22183 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
22184 pub temperature_board: i8,
22185 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
22186 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22187 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22188 pub temperature_core: [i8; 8],
22189}
22190impl ONBOARD_COMPUTER_STATUS_DATA {
22191 pub const ENCODED_LEN: usize = 238usize;
22192 pub const DEFAULT: Self = Self {
22193 time_usec: 0_u64,
22194 uptime: 0_u32,
22195 ram_usage: 0_u32,
22196 ram_total: 0_u32,
22197 storage_type: [0_u32; 4usize],
22198 storage_usage: [0_u32; 4usize],
22199 storage_total: [0_u32; 4usize],
22200 link_type: [0_u32; 6usize],
22201 link_tx_rate: [0_u32; 6usize],
22202 link_rx_rate: [0_u32; 6usize],
22203 link_tx_max: [0_u32; 6usize],
22204 link_rx_max: [0_u32; 6usize],
22205 fan_speed: [0_i16; 4usize],
22206 mavtype: 0_u8,
22207 cpu_cores: [0_u8; 8usize],
22208 cpu_combined: [0_u8; 10usize],
22209 gpu_cores: [0_u8; 4usize],
22210 gpu_combined: [0_u8; 10usize],
22211 temperature_board: 0_i8,
22212 temperature_core: [0_i8; 8usize],
22213 };
22214 #[cfg(feature = "arbitrary")]
22215 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22216 use arbitrary::{Arbitrary, Unstructured};
22217 let mut buf = [0u8; 1024];
22218 rng.fill_bytes(&mut buf);
22219 let mut unstructured = Unstructured::new(&buf);
22220 Self::arbitrary(&mut unstructured).unwrap_or_default()
22221 }
22222}
22223impl Default for ONBOARD_COMPUTER_STATUS_DATA {
22224 fn default() -> Self {
22225 Self::DEFAULT.clone()
22226 }
22227}
22228impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
22229 type Message = MavMessage;
22230 const ID: u32 = 390u32;
22231 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
22232 const EXTRA_CRC: u8 = 156u8;
22233 const ENCODED_LEN: usize = 238usize;
22234 fn deser(
22235 _version: MavlinkVersion,
22236 __input: &[u8],
22237 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22238 let avail_len = __input.len();
22239 let mut payload_buf = [0; Self::ENCODED_LEN];
22240 let mut buf = if avail_len < Self::ENCODED_LEN {
22241 payload_buf[0..avail_len].copy_from_slice(__input);
22242 Bytes::new(&payload_buf)
22243 } else {
22244 Bytes::new(__input)
22245 };
22246 let mut __struct = Self::default();
22247 __struct.time_usec = buf.get_u64_le()?;
22248 __struct.uptime = buf.get_u32_le()?;
22249 __struct.ram_usage = buf.get_u32_le()?;
22250 __struct.ram_total = buf.get_u32_le()?;
22251 for v in &mut __struct.storage_type {
22252 let val = buf.get_u32_le()?;
22253 *v = val;
22254 }
22255 for v in &mut __struct.storage_usage {
22256 let val = buf.get_u32_le()?;
22257 *v = val;
22258 }
22259 for v in &mut __struct.storage_total {
22260 let val = buf.get_u32_le()?;
22261 *v = val;
22262 }
22263 for v in &mut __struct.link_type {
22264 let val = buf.get_u32_le()?;
22265 *v = val;
22266 }
22267 for v in &mut __struct.link_tx_rate {
22268 let val = buf.get_u32_le()?;
22269 *v = val;
22270 }
22271 for v in &mut __struct.link_rx_rate {
22272 let val = buf.get_u32_le()?;
22273 *v = val;
22274 }
22275 for v in &mut __struct.link_tx_max {
22276 let val = buf.get_u32_le()?;
22277 *v = val;
22278 }
22279 for v in &mut __struct.link_rx_max {
22280 let val = buf.get_u32_le()?;
22281 *v = val;
22282 }
22283 for v in &mut __struct.fan_speed {
22284 let val = buf.get_i16_le()?;
22285 *v = val;
22286 }
22287 __struct.mavtype = buf.get_u8()?;
22288 for v in &mut __struct.cpu_cores {
22289 let val = buf.get_u8()?;
22290 *v = val;
22291 }
22292 for v in &mut __struct.cpu_combined {
22293 let val = buf.get_u8()?;
22294 *v = val;
22295 }
22296 for v in &mut __struct.gpu_cores {
22297 let val = buf.get_u8()?;
22298 *v = val;
22299 }
22300 for v in &mut __struct.gpu_combined {
22301 let val = buf.get_u8()?;
22302 *v = val;
22303 }
22304 __struct.temperature_board = buf.get_i8()?;
22305 for v in &mut __struct.temperature_core {
22306 let val = buf.get_i8()?;
22307 *v = val;
22308 }
22309 Ok(__struct)
22310 }
22311 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22312 let mut __tmp = BytesMut::new(bytes);
22313 #[allow(clippy::absurd_extreme_comparisons)]
22314 #[allow(unused_comparisons)]
22315 if __tmp.remaining() < Self::ENCODED_LEN {
22316 panic!(
22317 "buffer is too small (need {} bytes, but got {})",
22318 Self::ENCODED_LEN,
22319 __tmp.remaining(),
22320 )
22321 }
22322 __tmp.put_u64_le(self.time_usec);
22323 __tmp.put_u32_le(self.uptime);
22324 __tmp.put_u32_le(self.ram_usage);
22325 __tmp.put_u32_le(self.ram_total);
22326 for val in &self.storage_type {
22327 __tmp.put_u32_le(*val);
22328 }
22329 for val in &self.storage_usage {
22330 __tmp.put_u32_le(*val);
22331 }
22332 for val in &self.storage_total {
22333 __tmp.put_u32_le(*val);
22334 }
22335 for val in &self.link_type {
22336 __tmp.put_u32_le(*val);
22337 }
22338 for val in &self.link_tx_rate {
22339 __tmp.put_u32_le(*val);
22340 }
22341 for val in &self.link_rx_rate {
22342 __tmp.put_u32_le(*val);
22343 }
22344 for val in &self.link_tx_max {
22345 __tmp.put_u32_le(*val);
22346 }
22347 for val in &self.link_rx_max {
22348 __tmp.put_u32_le(*val);
22349 }
22350 for val in &self.fan_speed {
22351 __tmp.put_i16_le(*val);
22352 }
22353 __tmp.put_u8(self.mavtype);
22354 for val in &self.cpu_cores {
22355 __tmp.put_u8(*val);
22356 }
22357 for val in &self.cpu_combined {
22358 __tmp.put_u8(*val);
22359 }
22360 for val in &self.gpu_cores {
22361 __tmp.put_u8(*val);
22362 }
22363 for val in &self.gpu_combined {
22364 __tmp.put_u8(*val);
22365 }
22366 __tmp.put_i8(self.temperature_board);
22367 for val in &self.temperature_core {
22368 __tmp.put_i8(*val);
22369 }
22370 if matches!(version, MavlinkVersion::V2) {
22371 let len = __tmp.len();
22372 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22373 } else {
22374 __tmp.len()
22375 }
22376 }
22377}
22378#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
22379#[doc = ""]
22380#[doc = "ID: 12918"]
22381#[derive(Debug, Clone, PartialEq)]
22382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22383#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22384#[cfg_attr(feature = "ts", derive(TS))]
22385#[cfg_attr(feature = "ts", ts(export))]
22386pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
22387 #[doc = "Status level indicating if arming is allowed."]
22388 pub status: MavOdidArmStatus,
22389 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
22390 #[cfg_attr(feature = "ts", ts(type = "string"))]
22391 pub error: CharArray<50>,
22392}
22393impl OPEN_DRONE_ID_ARM_STATUS_DATA {
22394 pub const ENCODED_LEN: usize = 51usize;
22395 pub const DEFAULT: Self = Self {
22396 status: MavOdidArmStatus::DEFAULT,
22397 error: CharArray::new([0_u8; 50usize]),
22398 };
22399 #[cfg(feature = "arbitrary")]
22400 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22401 use arbitrary::{Arbitrary, Unstructured};
22402 let mut buf = [0u8; 1024];
22403 rng.fill_bytes(&mut buf);
22404 let mut unstructured = Unstructured::new(&buf);
22405 Self::arbitrary(&mut unstructured).unwrap_or_default()
22406 }
22407}
22408impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
22409 fn default() -> Self {
22410 Self::DEFAULT.clone()
22411 }
22412}
22413impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
22414 type Message = MavMessage;
22415 const ID: u32 = 12918u32;
22416 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
22417 const EXTRA_CRC: u8 = 139u8;
22418 const ENCODED_LEN: usize = 51usize;
22419 fn deser(
22420 _version: MavlinkVersion,
22421 __input: &[u8],
22422 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22423 let avail_len = __input.len();
22424 let mut payload_buf = [0; Self::ENCODED_LEN];
22425 let mut buf = if avail_len < Self::ENCODED_LEN {
22426 payload_buf[0..avail_len].copy_from_slice(__input);
22427 Bytes::new(&payload_buf)
22428 } else {
22429 Bytes::new(__input)
22430 };
22431 let mut __struct = Self::default();
22432 let tmp = buf.get_u8()?;
22433 __struct.status =
22434 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22435 enum_type: "MavOdidArmStatus",
22436 value: tmp as u64,
22437 })?;
22438 let mut tmp = [0_u8; 50usize];
22439 for v in &mut tmp {
22440 *v = buf.get_u8()?;
22441 }
22442 __struct.error = CharArray::new(tmp);
22443 Ok(__struct)
22444 }
22445 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22446 let mut __tmp = BytesMut::new(bytes);
22447 #[allow(clippy::absurd_extreme_comparisons)]
22448 #[allow(unused_comparisons)]
22449 if __tmp.remaining() < Self::ENCODED_LEN {
22450 panic!(
22451 "buffer is too small (need {} bytes, but got {})",
22452 Self::ENCODED_LEN,
22453 __tmp.remaining(),
22454 )
22455 }
22456 __tmp.put_u8(self.status as u8);
22457 for val in &self.error {
22458 __tmp.put_u8(*val);
22459 }
22460 if matches!(version, MavlinkVersion::V2) {
22461 let len = __tmp.len();
22462 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22463 } else {
22464 __tmp.len()
22465 }
22466 }
22467}
22468#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
22469#[doc = ""]
22470#[doc = "ID: 12902"]
22471#[derive(Debug, Clone, PartialEq)]
22472#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22473#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22474#[cfg_attr(feature = "ts", derive(TS))]
22475#[cfg_attr(feature = "ts", ts(export))]
22476pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
22477 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22478 pub timestamp: u32,
22479 #[doc = "System ID (0 for broadcast)."]
22480 pub target_system: u8,
22481 #[doc = "Component ID (0 for broadcast)."]
22482 pub target_component: u8,
22483 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22484 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22485 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22486 pub id_or_mac: [u8; 20],
22487 #[doc = "Indicates the type of authentication."]
22488 pub authentication_type: MavOdidAuthType,
22489 #[doc = "Allowed range is 0 - 15."]
22490 pub data_page: u8,
22491 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
22492 pub last_page_index: u8,
22493 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
22494 pub length: u8,
22495 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
22496 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22497 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22498 pub authentication_data: [u8; 23],
22499}
22500impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
22501 pub const ENCODED_LEN: usize = 53usize;
22502 pub const DEFAULT: Self = Self {
22503 timestamp: 0_u32,
22504 target_system: 0_u8,
22505 target_component: 0_u8,
22506 id_or_mac: [0_u8; 20usize],
22507 authentication_type: MavOdidAuthType::DEFAULT,
22508 data_page: 0_u8,
22509 last_page_index: 0_u8,
22510 length: 0_u8,
22511 authentication_data: [0_u8; 23usize],
22512 };
22513 #[cfg(feature = "arbitrary")]
22514 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22515 use arbitrary::{Arbitrary, Unstructured};
22516 let mut buf = [0u8; 1024];
22517 rng.fill_bytes(&mut buf);
22518 let mut unstructured = Unstructured::new(&buf);
22519 Self::arbitrary(&mut unstructured).unwrap_or_default()
22520 }
22521}
22522impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
22523 fn default() -> Self {
22524 Self::DEFAULT.clone()
22525 }
22526}
22527impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
22528 type Message = MavMessage;
22529 const ID: u32 = 12902u32;
22530 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
22531 const EXTRA_CRC: u8 = 140u8;
22532 const ENCODED_LEN: usize = 53usize;
22533 fn deser(
22534 _version: MavlinkVersion,
22535 __input: &[u8],
22536 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22537 let avail_len = __input.len();
22538 let mut payload_buf = [0; Self::ENCODED_LEN];
22539 let mut buf = if avail_len < Self::ENCODED_LEN {
22540 payload_buf[0..avail_len].copy_from_slice(__input);
22541 Bytes::new(&payload_buf)
22542 } else {
22543 Bytes::new(__input)
22544 };
22545 let mut __struct = Self::default();
22546 __struct.timestamp = buf.get_u32_le()?;
22547 __struct.target_system = buf.get_u8()?;
22548 __struct.target_component = buf.get_u8()?;
22549 for v in &mut __struct.id_or_mac {
22550 let val = buf.get_u8()?;
22551 *v = val;
22552 }
22553 let tmp = buf.get_u8()?;
22554 __struct.authentication_type =
22555 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22556 enum_type: "MavOdidAuthType",
22557 value: tmp as u64,
22558 })?;
22559 __struct.data_page = buf.get_u8()?;
22560 __struct.last_page_index = buf.get_u8()?;
22561 __struct.length = buf.get_u8()?;
22562 for v in &mut __struct.authentication_data {
22563 let val = buf.get_u8()?;
22564 *v = val;
22565 }
22566 Ok(__struct)
22567 }
22568 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22569 let mut __tmp = BytesMut::new(bytes);
22570 #[allow(clippy::absurd_extreme_comparisons)]
22571 #[allow(unused_comparisons)]
22572 if __tmp.remaining() < Self::ENCODED_LEN {
22573 panic!(
22574 "buffer is too small (need {} bytes, but got {})",
22575 Self::ENCODED_LEN,
22576 __tmp.remaining(),
22577 )
22578 }
22579 __tmp.put_u32_le(self.timestamp);
22580 __tmp.put_u8(self.target_system);
22581 __tmp.put_u8(self.target_component);
22582 for val in &self.id_or_mac {
22583 __tmp.put_u8(*val);
22584 }
22585 __tmp.put_u8(self.authentication_type as u8);
22586 __tmp.put_u8(self.data_page);
22587 __tmp.put_u8(self.last_page_index);
22588 __tmp.put_u8(self.length);
22589 for val in &self.authentication_data {
22590 __tmp.put_u8(*val);
22591 }
22592 if matches!(version, MavlinkVersion::V2) {
22593 let len = __tmp.len();
22594 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22595 } else {
22596 __tmp.len()
22597 }
22598 }
22599}
22600#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
22601#[doc = ""]
22602#[doc = "ID: 12900"]
22603#[derive(Debug, Clone, PartialEq)]
22604#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22605#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22606#[cfg_attr(feature = "ts", derive(TS))]
22607#[cfg_attr(feature = "ts", ts(export))]
22608pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
22609 #[doc = "System ID (0 for broadcast)."]
22610 pub target_system: u8,
22611 #[doc = "Component ID (0 for broadcast)."]
22612 pub target_component: u8,
22613 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22614 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22615 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22616 pub id_or_mac: [u8; 20],
22617 #[doc = "Indicates the format for the uas_id field of this message."]
22618 pub id_type: MavOdidIdType,
22619 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
22620 pub ua_type: MavOdidUaType,
22621 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
22622 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22623 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22624 pub uas_id: [u8; 20],
22625}
22626impl OPEN_DRONE_ID_BASIC_ID_DATA {
22627 pub const ENCODED_LEN: usize = 44usize;
22628 pub const DEFAULT: Self = Self {
22629 target_system: 0_u8,
22630 target_component: 0_u8,
22631 id_or_mac: [0_u8; 20usize],
22632 id_type: MavOdidIdType::DEFAULT,
22633 ua_type: MavOdidUaType::DEFAULT,
22634 uas_id: [0_u8; 20usize],
22635 };
22636 #[cfg(feature = "arbitrary")]
22637 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22638 use arbitrary::{Arbitrary, Unstructured};
22639 let mut buf = [0u8; 1024];
22640 rng.fill_bytes(&mut buf);
22641 let mut unstructured = Unstructured::new(&buf);
22642 Self::arbitrary(&mut unstructured).unwrap_or_default()
22643 }
22644}
22645impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
22646 fn default() -> Self {
22647 Self::DEFAULT.clone()
22648 }
22649}
22650impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
22651 type Message = MavMessage;
22652 const ID: u32 = 12900u32;
22653 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
22654 const EXTRA_CRC: u8 = 114u8;
22655 const ENCODED_LEN: usize = 44usize;
22656 fn deser(
22657 _version: MavlinkVersion,
22658 __input: &[u8],
22659 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22660 let avail_len = __input.len();
22661 let mut payload_buf = [0; Self::ENCODED_LEN];
22662 let mut buf = if avail_len < Self::ENCODED_LEN {
22663 payload_buf[0..avail_len].copy_from_slice(__input);
22664 Bytes::new(&payload_buf)
22665 } else {
22666 Bytes::new(__input)
22667 };
22668 let mut __struct = Self::default();
22669 __struct.target_system = buf.get_u8()?;
22670 __struct.target_component = buf.get_u8()?;
22671 for v in &mut __struct.id_or_mac {
22672 let val = buf.get_u8()?;
22673 *v = val;
22674 }
22675 let tmp = buf.get_u8()?;
22676 __struct.id_type =
22677 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22678 enum_type: "MavOdidIdType",
22679 value: tmp as u64,
22680 })?;
22681 let tmp = buf.get_u8()?;
22682 __struct.ua_type =
22683 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22684 enum_type: "MavOdidUaType",
22685 value: tmp as u64,
22686 })?;
22687 for v in &mut __struct.uas_id {
22688 let val = buf.get_u8()?;
22689 *v = val;
22690 }
22691 Ok(__struct)
22692 }
22693 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22694 let mut __tmp = BytesMut::new(bytes);
22695 #[allow(clippy::absurd_extreme_comparisons)]
22696 #[allow(unused_comparisons)]
22697 if __tmp.remaining() < Self::ENCODED_LEN {
22698 panic!(
22699 "buffer is too small (need {} bytes, but got {})",
22700 Self::ENCODED_LEN,
22701 __tmp.remaining(),
22702 )
22703 }
22704 __tmp.put_u8(self.target_system);
22705 __tmp.put_u8(self.target_component);
22706 for val in &self.id_or_mac {
22707 __tmp.put_u8(*val);
22708 }
22709 __tmp.put_u8(self.id_type as u8);
22710 __tmp.put_u8(self.ua_type as u8);
22711 for val in &self.uas_id {
22712 __tmp.put_u8(*val);
22713 }
22714 if matches!(version, MavlinkVersion::V2) {
22715 let len = __tmp.len();
22716 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22717 } else {
22718 __tmp.len()
22719 }
22720 }
22721}
22722#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
22723#[doc = ""]
22724#[doc = "ID: 12901"]
22725#[derive(Debug, Clone, PartialEq)]
22726#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22727#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22728#[cfg_attr(feature = "ts", derive(TS))]
22729#[cfg_attr(feature = "ts", ts(export))]
22730pub struct OPEN_DRONE_ID_LOCATION_DATA {
22731 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22732 pub latitude: i32,
22733 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
22734 pub longitude: i32,
22735 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
22736 pub altitude_barometric: f32,
22737 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
22738 pub altitude_geodetic: f32,
22739 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
22740 pub height: f32,
22741 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
22742 pub timestamp: f32,
22743 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
22744 pub direction: u16,
22745 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
22746 pub speed_horizontal: u16,
22747 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
22748 pub speed_vertical: i16,
22749 #[doc = "System ID (0 for broadcast)."]
22750 pub target_system: u8,
22751 #[doc = "Component ID (0 for broadcast)."]
22752 pub target_component: u8,
22753 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22754 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22755 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22756 pub id_or_mac: [u8; 20],
22757 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
22758 pub status: MavOdidStatus,
22759 #[doc = "Indicates the reference point for the height field."]
22760 pub height_reference: MavOdidHeightRef,
22761 #[doc = "The accuracy of the horizontal position."]
22762 pub horizontal_accuracy: MavOdidHorAcc,
22763 #[doc = "The accuracy of the vertical position."]
22764 pub vertical_accuracy: MavOdidVerAcc,
22765 #[doc = "The accuracy of the barometric altitude."]
22766 pub barometer_accuracy: MavOdidVerAcc,
22767 #[doc = "The accuracy of the horizontal and vertical speed."]
22768 pub speed_accuracy: MavOdidSpeedAcc,
22769 #[doc = "The accuracy of the timestamps."]
22770 pub timestamp_accuracy: MavOdidTimeAcc,
22771}
22772impl OPEN_DRONE_ID_LOCATION_DATA {
22773 pub const ENCODED_LEN: usize = 59usize;
22774 pub const DEFAULT: Self = Self {
22775 latitude: 0_i32,
22776 longitude: 0_i32,
22777 altitude_barometric: 0.0_f32,
22778 altitude_geodetic: 0.0_f32,
22779 height: 0.0_f32,
22780 timestamp: 0.0_f32,
22781 direction: 0_u16,
22782 speed_horizontal: 0_u16,
22783 speed_vertical: 0_i16,
22784 target_system: 0_u8,
22785 target_component: 0_u8,
22786 id_or_mac: [0_u8; 20usize],
22787 status: MavOdidStatus::DEFAULT,
22788 height_reference: MavOdidHeightRef::DEFAULT,
22789 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
22790 vertical_accuracy: MavOdidVerAcc::DEFAULT,
22791 barometer_accuracy: MavOdidVerAcc::DEFAULT,
22792 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
22793 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
22794 };
22795 #[cfg(feature = "arbitrary")]
22796 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22797 use arbitrary::{Arbitrary, Unstructured};
22798 let mut buf = [0u8; 1024];
22799 rng.fill_bytes(&mut buf);
22800 let mut unstructured = Unstructured::new(&buf);
22801 Self::arbitrary(&mut unstructured).unwrap_or_default()
22802 }
22803}
22804impl Default for OPEN_DRONE_ID_LOCATION_DATA {
22805 fn default() -> Self {
22806 Self::DEFAULT.clone()
22807 }
22808}
22809impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
22810 type Message = MavMessage;
22811 const ID: u32 = 12901u32;
22812 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
22813 const EXTRA_CRC: u8 = 254u8;
22814 const ENCODED_LEN: usize = 59usize;
22815 fn deser(
22816 _version: MavlinkVersion,
22817 __input: &[u8],
22818 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22819 let avail_len = __input.len();
22820 let mut payload_buf = [0; Self::ENCODED_LEN];
22821 let mut buf = if avail_len < Self::ENCODED_LEN {
22822 payload_buf[0..avail_len].copy_from_slice(__input);
22823 Bytes::new(&payload_buf)
22824 } else {
22825 Bytes::new(__input)
22826 };
22827 let mut __struct = Self::default();
22828 __struct.latitude = buf.get_i32_le()?;
22829 __struct.longitude = buf.get_i32_le()?;
22830 __struct.altitude_barometric = buf.get_f32_le()?;
22831 __struct.altitude_geodetic = buf.get_f32_le()?;
22832 __struct.height = buf.get_f32_le()?;
22833 __struct.timestamp = buf.get_f32_le()?;
22834 __struct.direction = buf.get_u16_le()?;
22835 __struct.speed_horizontal = buf.get_u16_le()?;
22836 __struct.speed_vertical = buf.get_i16_le()?;
22837 __struct.target_system = buf.get_u8()?;
22838 __struct.target_component = buf.get_u8()?;
22839 for v in &mut __struct.id_or_mac {
22840 let val = buf.get_u8()?;
22841 *v = val;
22842 }
22843 let tmp = buf.get_u8()?;
22844 __struct.status =
22845 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22846 enum_type: "MavOdidStatus",
22847 value: tmp as u64,
22848 })?;
22849 let tmp = buf.get_u8()?;
22850 __struct.height_reference =
22851 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22852 enum_type: "MavOdidHeightRef",
22853 value: tmp as u64,
22854 })?;
22855 let tmp = buf.get_u8()?;
22856 __struct.horizontal_accuracy =
22857 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22858 enum_type: "MavOdidHorAcc",
22859 value: tmp as u64,
22860 })?;
22861 let tmp = buf.get_u8()?;
22862 __struct.vertical_accuracy =
22863 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22864 enum_type: "MavOdidVerAcc",
22865 value: tmp as u64,
22866 })?;
22867 let tmp = buf.get_u8()?;
22868 __struct.barometer_accuracy =
22869 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22870 enum_type: "MavOdidVerAcc",
22871 value: tmp as u64,
22872 })?;
22873 let tmp = buf.get_u8()?;
22874 __struct.speed_accuracy =
22875 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22876 enum_type: "MavOdidSpeedAcc",
22877 value: tmp as u64,
22878 })?;
22879 let tmp = buf.get_u8()?;
22880 __struct.timestamp_accuracy =
22881 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22882 enum_type: "MavOdidTimeAcc",
22883 value: tmp as u64,
22884 })?;
22885 Ok(__struct)
22886 }
22887 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22888 let mut __tmp = BytesMut::new(bytes);
22889 #[allow(clippy::absurd_extreme_comparisons)]
22890 #[allow(unused_comparisons)]
22891 if __tmp.remaining() < Self::ENCODED_LEN {
22892 panic!(
22893 "buffer is too small (need {} bytes, but got {})",
22894 Self::ENCODED_LEN,
22895 __tmp.remaining(),
22896 )
22897 }
22898 __tmp.put_i32_le(self.latitude);
22899 __tmp.put_i32_le(self.longitude);
22900 __tmp.put_f32_le(self.altitude_barometric);
22901 __tmp.put_f32_le(self.altitude_geodetic);
22902 __tmp.put_f32_le(self.height);
22903 __tmp.put_f32_le(self.timestamp);
22904 __tmp.put_u16_le(self.direction);
22905 __tmp.put_u16_le(self.speed_horizontal);
22906 __tmp.put_i16_le(self.speed_vertical);
22907 __tmp.put_u8(self.target_system);
22908 __tmp.put_u8(self.target_component);
22909 for val in &self.id_or_mac {
22910 __tmp.put_u8(*val);
22911 }
22912 __tmp.put_u8(self.status as u8);
22913 __tmp.put_u8(self.height_reference as u8);
22914 __tmp.put_u8(self.horizontal_accuracy as u8);
22915 __tmp.put_u8(self.vertical_accuracy as u8);
22916 __tmp.put_u8(self.barometer_accuracy as u8);
22917 __tmp.put_u8(self.speed_accuracy as u8);
22918 __tmp.put_u8(self.timestamp_accuracy as u8);
22919 if matches!(version, MavlinkVersion::V2) {
22920 let len = __tmp.len();
22921 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22922 } else {
22923 __tmp.len()
22924 }
22925 }
22926}
22927#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
22928#[doc = ""]
22929#[doc = "ID: 12915"]
22930#[derive(Debug, Clone, PartialEq)]
22931#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22932#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22933#[cfg_attr(feature = "ts", derive(TS))]
22934#[cfg_attr(feature = "ts", ts(export))]
22935pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22936 #[doc = "System ID (0 for broadcast)."]
22937 pub target_system: u8,
22938 #[doc = "Component ID (0 for broadcast)."]
22939 pub target_component: u8,
22940 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22941 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22942 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22943 pub id_or_mac: [u8; 20],
22944 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
22945 pub single_message_size: u8,
22946 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
22947 pub msg_pack_size: u8,
22948 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
22949 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22950 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
22951 pub messages: [u8; 225],
22952}
22953impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22954 pub const ENCODED_LEN: usize = 249usize;
22955 pub const DEFAULT: Self = Self {
22956 target_system: 0_u8,
22957 target_component: 0_u8,
22958 id_or_mac: [0_u8; 20usize],
22959 single_message_size: 0_u8,
22960 msg_pack_size: 0_u8,
22961 messages: [0_u8; 225usize],
22962 };
22963 #[cfg(feature = "arbitrary")]
22964 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22965 use arbitrary::{Arbitrary, Unstructured};
22966 let mut buf = [0u8; 1024];
22967 rng.fill_bytes(&mut buf);
22968 let mut unstructured = Unstructured::new(&buf);
22969 Self::arbitrary(&mut unstructured).unwrap_or_default()
22970 }
22971}
22972impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22973 fn default() -> Self {
22974 Self::DEFAULT.clone()
22975 }
22976}
22977impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
22978 type Message = MavMessage;
22979 const ID: u32 = 12915u32;
22980 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
22981 const EXTRA_CRC: u8 = 94u8;
22982 const ENCODED_LEN: usize = 249usize;
22983 fn deser(
22984 _version: MavlinkVersion,
22985 __input: &[u8],
22986 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22987 let avail_len = __input.len();
22988 let mut payload_buf = [0; Self::ENCODED_LEN];
22989 let mut buf = if avail_len < Self::ENCODED_LEN {
22990 payload_buf[0..avail_len].copy_from_slice(__input);
22991 Bytes::new(&payload_buf)
22992 } else {
22993 Bytes::new(__input)
22994 };
22995 let mut __struct = Self::default();
22996 __struct.target_system = buf.get_u8()?;
22997 __struct.target_component = buf.get_u8()?;
22998 for v in &mut __struct.id_or_mac {
22999 let val = buf.get_u8()?;
23000 *v = val;
23001 }
23002 __struct.single_message_size = buf.get_u8()?;
23003 __struct.msg_pack_size = buf.get_u8()?;
23004 for v in &mut __struct.messages {
23005 let val = buf.get_u8()?;
23006 *v = val;
23007 }
23008 Ok(__struct)
23009 }
23010 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23011 let mut __tmp = BytesMut::new(bytes);
23012 #[allow(clippy::absurd_extreme_comparisons)]
23013 #[allow(unused_comparisons)]
23014 if __tmp.remaining() < Self::ENCODED_LEN {
23015 panic!(
23016 "buffer is too small (need {} bytes, but got {})",
23017 Self::ENCODED_LEN,
23018 __tmp.remaining(),
23019 )
23020 }
23021 __tmp.put_u8(self.target_system);
23022 __tmp.put_u8(self.target_component);
23023 for val in &self.id_or_mac {
23024 __tmp.put_u8(*val);
23025 }
23026 __tmp.put_u8(self.single_message_size);
23027 __tmp.put_u8(self.msg_pack_size);
23028 for val in &self.messages {
23029 __tmp.put_u8(*val);
23030 }
23031 if matches!(version, MavlinkVersion::V2) {
23032 let len = __tmp.len();
23033 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23034 } else {
23035 __tmp.len()
23036 }
23037 }
23038}
23039#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
23040#[doc = ""]
23041#[doc = "ID: 12905"]
23042#[derive(Debug, Clone, PartialEq)]
23043#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23044#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23045#[cfg_attr(feature = "ts", derive(TS))]
23046#[cfg_attr(feature = "ts", ts(export))]
23047pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
23048 #[doc = "System ID (0 for broadcast)."]
23049 pub target_system: u8,
23050 #[doc = "Component ID (0 for broadcast)."]
23051 pub target_component: u8,
23052 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23053 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23054 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23055 pub id_or_mac: [u8; 20],
23056 #[doc = "Indicates the type of the operator_id field."]
23057 pub operator_id_type: MavOdidOperatorIdType,
23058 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
23059 #[cfg_attr(feature = "ts", ts(type = "string"))]
23060 pub operator_id: CharArray<20>,
23061}
23062impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
23063 pub const ENCODED_LEN: usize = 43usize;
23064 pub const DEFAULT: Self = Self {
23065 target_system: 0_u8,
23066 target_component: 0_u8,
23067 id_or_mac: [0_u8; 20usize],
23068 operator_id_type: MavOdidOperatorIdType::DEFAULT,
23069 operator_id: CharArray::new([0_u8; 20usize]),
23070 };
23071 #[cfg(feature = "arbitrary")]
23072 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23073 use arbitrary::{Arbitrary, Unstructured};
23074 let mut buf = [0u8; 1024];
23075 rng.fill_bytes(&mut buf);
23076 let mut unstructured = Unstructured::new(&buf);
23077 Self::arbitrary(&mut unstructured).unwrap_or_default()
23078 }
23079}
23080impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
23081 fn default() -> Self {
23082 Self::DEFAULT.clone()
23083 }
23084}
23085impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
23086 type Message = MavMessage;
23087 const ID: u32 = 12905u32;
23088 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
23089 const EXTRA_CRC: u8 = 49u8;
23090 const ENCODED_LEN: usize = 43usize;
23091 fn deser(
23092 _version: MavlinkVersion,
23093 __input: &[u8],
23094 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23095 let avail_len = __input.len();
23096 let mut payload_buf = [0; Self::ENCODED_LEN];
23097 let mut buf = if avail_len < Self::ENCODED_LEN {
23098 payload_buf[0..avail_len].copy_from_slice(__input);
23099 Bytes::new(&payload_buf)
23100 } else {
23101 Bytes::new(__input)
23102 };
23103 let mut __struct = Self::default();
23104 __struct.target_system = buf.get_u8()?;
23105 __struct.target_component = buf.get_u8()?;
23106 for v in &mut __struct.id_or_mac {
23107 let val = buf.get_u8()?;
23108 *v = val;
23109 }
23110 let tmp = buf.get_u8()?;
23111 __struct.operator_id_type =
23112 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23113 enum_type: "MavOdidOperatorIdType",
23114 value: tmp as u64,
23115 })?;
23116 let mut tmp = [0_u8; 20usize];
23117 for v in &mut tmp {
23118 *v = buf.get_u8()?;
23119 }
23120 __struct.operator_id = CharArray::new(tmp);
23121 Ok(__struct)
23122 }
23123 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23124 let mut __tmp = BytesMut::new(bytes);
23125 #[allow(clippy::absurd_extreme_comparisons)]
23126 #[allow(unused_comparisons)]
23127 if __tmp.remaining() < Self::ENCODED_LEN {
23128 panic!(
23129 "buffer is too small (need {} bytes, but got {})",
23130 Self::ENCODED_LEN,
23131 __tmp.remaining(),
23132 )
23133 }
23134 __tmp.put_u8(self.target_system);
23135 __tmp.put_u8(self.target_component);
23136 for val in &self.id_or_mac {
23137 __tmp.put_u8(*val);
23138 }
23139 __tmp.put_u8(self.operator_id_type as u8);
23140 for val in &self.operator_id {
23141 __tmp.put_u8(*val);
23142 }
23143 if matches!(version, MavlinkVersion::V2) {
23144 let len = __tmp.len();
23145 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23146 } else {
23147 __tmp.len()
23148 }
23149 }
23150}
23151#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
23152#[doc = ""]
23153#[doc = "ID: 12903"]
23154#[derive(Debug, Clone, PartialEq)]
23155#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23157#[cfg_attr(feature = "ts", derive(TS))]
23158#[cfg_attr(feature = "ts", ts(export))]
23159pub struct OPEN_DRONE_ID_SELF_ID_DATA {
23160 #[doc = "System ID (0 for broadcast)."]
23161 pub target_system: u8,
23162 #[doc = "Component ID (0 for broadcast)."]
23163 pub target_component: u8,
23164 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23165 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23166 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23167 pub id_or_mac: [u8; 20],
23168 #[doc = "Indicates the type of the description field."]
23169 pub description_type: MavOdidDescType,
23170 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
23171 #[cfg_attr(feature = "ts", ts(type = "string"))]
23172 pub description: CharArray<23>,
23173}
23174impl OPEN_DRONE_ID_SELF_ID_DATA {
23175 pub const ENCODED_LEN: usize = 46usize;
23176 pub const DEFAULT: Self = Self {
23177 target_system: 0_u8,
23178 target_component: 0_u8,
23179 id_or_mac: [0_u8; 20usize],
23180 description_type: MavOdidDescType::DEFAULT,
23181 description: CharArray::new([0_u8; 23usize]),
23182 };
23183 #[cfg(feature = "arbitrary")]
23184 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23185 use arbitrary::{Arbitrary, Unstructured};
23186 let mut buf = [0u8; 1024];
23187 rng.fill_bytes(&mut buf);
23188 let mut unstructured = Unstructured::new(&buf);
23189 Self::arbitrary(&mut unstructured).unwrap_or_default()
23190 }
23191}
23192impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
23193 fn default() -> Self {
23194 Self::DEFAULT.clone()
23195 }
23196}
23197impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
23198 type Message = MavMessage;
23199 const ID: u32 = 12903u32;
23200 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
23201 const EXTRA_CRC: u8 = 249u8;
23202 const ENCODED_LEN: usize = 46usize;
23203 fn deser(
23204 _version: MavlinkVersion,
23205 __input: &[u8],
23206 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23207 let avail_len = __input.len();
23208 let mut payload_buf = [0; Self::ENCODED_LEN];
23209 let mut buf = if avail_len < Self::ENCODED_LEN {
23210 payload_buf[0..avail_len].copy_from_slice(__input);
23211 Bytes::new(&payload_buf)
23212 } else {
23213 Bytes::new(__input)
23214 };
23215 let mut __struct = Self::default();
23216 __struct.target_system = buf.get_u8()?;
23217 __struct.target_component = buf.get_u8()?;
23218 for v in &mut __struct.id_or_mac {
23219 let val = buf.get_u8()?;
23220 *v = val;
23221 }
23222 let tmp = buf.get_u8()?;
23223 __struct.description_type =
23224 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23225 enum_type: "MavOdidDescType",
23226 value: tmp as u64,
23227 })?;
23228 let mut tmp = [0_u8; 23usize];
23229 for v in &mut tmp {
23230 *v = buf.get_u8()?;
23231 }
23232 __struct.description = CharArray::new(tmp);
23233 Ok(__struct)
23234 }
23235 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23236 let mut __tmp = BytesMut::new(bytes);
23237 #[allow(clippy::absurd_extreme_comparisons)]
23238 #[allow(unused_comparisons)]
23239 if __tmp.remaining() < Self::ENCODED_LEN {
23240 panic!(
23241 "buffer is too small (need {} bytes, but got {})",
23242 Self::ENCODED_LEN,
23243 __tmp.remaining(),
23244 )
23245 }
23246 __tmp.put_u8(self.target_system);
23247 __tmp.put_u8(self.target_component);
23248 for val in &self.id_or_mac {
23249 __tmp.put_u8(*val);
23250 }
23251 __tmp.put_u8(self.description_type as u8);
23252 for val in &self.description {
23253 __tmp.put_u8(*val);
23254 }
23255 if matches!(version, MavlinkVersion::V2) {
23256 let len = __tmp.len();
23257 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23258 } else {
23259 __tmp.len()
23260 }
23261 }
23262}
23263#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
23264#[doc = ""]
23265#[doc = "ID: 12904"]
23266#[derive(Debug, Clone, PartialEq)]
23267#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23268#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23269#[cfg_attr(feature = "ts", derive(TS))]
23270#[cfg_attr(feature = "ts", ts(export))]
23271pub struct OPEN_DRONE_ID_SYSTEM_DATA {
23272 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
23273 pub operator_latitude: i32,
23274 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
23275 pub operator_longitude: i32,
23276 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
23277 pub area_ceiling: f32,
23278 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
23279 pub area_floor: f32,
23280 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
23281 pub operator_altitude_geo: f32,
23282 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
23283 pub timestamp: u32,
23284 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
23285 pub area_count: u16,
23286 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
23287 pub area_radius: u16,
23288 #[doc = "System ID (0 for broadcast)."]
23289 pub target_system: u8,
23290 #[doc = "Component ID (0 for broadcast)."]
23291 pub target_component: u8,
23292 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
23293 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23294 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
23295 pub id_or_mac: [u8; 20],
23296 #[doc = "Specifies the operator location type."]
23297 pub operator_location_type: MavOdidOperatorLocationType,
23298 #[doc = "Specifies the classification type of the UA."]
23299 pub classification_type: MavOdidClassificationType,
23300 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
23301 pub category_eu: MavOdidCategoryEu,
23302 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
23303 pub class_eu: MavOdidClassEu,
23304}
23305impl OPEN_DRONE_ID_SYSTEM_DATA {
23306 pub const ENCODED_LEN: usize = 54usize;
23307 pub const DEFAULT: Self = Self {
23308 operator_latitude: 0_i32,
23309 operator_longitude: 0_i32,
23310 area_ceiling: 0.0_f32,
23311 area_floor: 0.0_f32,
23312 operator_altitude_geo: 0.0_f32,
23313 timestamp: 0_u32,
23314 area_count: 0_u16,
23315 area_radius: 0_u16,
23316 target_system: 0_u8,
23317 target_component: 0_u8,
23318 id_or_mac: [0_u8; 20usize],
23319 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
23320 classification_type: MavOdidClassificationType::DEFAULT,
23321 category_eu: MavOdidCategoryEu::DEFAULT,
23322 class_eu: MavOdidClassEu::DEFAULT,
23323 };
23324 #[cfg(feature = "arbitrary")]
23325 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23326 use arbitrary::{Arbitrary, Unstructured};
23327 let mut buf = [0u8; 1024];
23328 rng.fill_bytes(&mut buf);
23329 let mut unstructured = Unstructured::new(&buf);
23330 Self::arbitrary(&mut unstructured).unwrap_or_default()
23331 }
23332}
23333impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
23334 fn default() -> Self {
23335 Self::DEFAULT.clone()
23336 }
23337}
23338impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
23339 type Message = MavMessage;
23340 const ID: u32 = 12904u32;
23341 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
23342 const EXTRA_CRC: u8 = 77u8;
23343 const ENCODED_LEN: usize = 54usize;
23344 fn deser(
23345 _version: MavlinkVersion,
23346 __input: &[u8],
23347 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23348 let avail_len = __input.len();
23349 let mut payload_buf = [0; Self::ENCODED_LEN];
23350 let mut buf = if avail_len < Self::ENCODED_LEN {
23351 payload_buf[0..avail_len].copy_from_slice(__input);
23352 Bytes::new(&payload_buf)
23353 } else {
23354 Bytes::new(__input)
23355 };
23356 let mut __struct = Self::default();
23357 __struct.operator_latitude = buf.get_i32_le()?;
23358 __struct.operator_longitude = buf.get_i32_le()?;
23359 __struct.area_ceiling = buf.get_f32_le()?;
23360 __struct.area_floor = buf.get_f32_le()?;
23361 __struct.operator_altitude_geo = buf.get_f32_le()?;
23362 __struct.timestamp = buf.get_u32_le()?;
23363 __struct.area_count = buf.get_u16_le()?;
23364 __struct.area_radius = buf.get_u16_le()?;
23365 __struct.target_system = buf.get_u8()?;
23366 __struct.target_component = buf.get_u8()?;
23367 for v in &mut __struct.id_or_mac {
23368 let val = buf.get_u8()?;
23369 *v = val;
23370 }
23371 let tmp = buf.get_u8()?;
23372 __struct.operator_location_type =
23373 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23374 enum_type: "MavOdidOperatorLocationType",
23375 value: tmp as u64,
23376 })?;
23377 let tmp = buf.get_u8()?;
23378 __struct.classification_type =
23379 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23380 enum_type: "MavOdidClassificationType",
23381 value: tmp as u64,
23382 })?;
23383 let tmp = buf.get_u8()?;
23384 __struct.category_eu =
23385 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23386 enum_type: "MavOdidCategoryEu",
23387 value: tmp as u64,
23388 })?;
23389 let tmp = buf.get_u8()?;
23390 __struct.class_eu =
23391 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23392 enum_type: "MavOdidClassEu",
23393 value: tmp as u64,
23394 })?;
23395 Ok(__struct)
23396 }
23397 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23398 let mut __tmp = BytesMut::new(bytes);
23399 #[allow(clippy::absurd_extreme_comparisons)]
23400 #[allow(unused_comparisons)]
23401 if __tmp.remaining() < Self::ENCODED_LEN {
23402 panic!(
23403 "buffer is too small (need {} bytes, but got {})",
23404 Self::ENCODED_LEN,
23405 __tmp.remaining(),
23406 )
23407 }
23408 __tmp.put_i32_le(self.operator_latitude);
23409 __tmp.put_i32_le(self.operator_longitude);
23410 __tmp.put_f32_le(self.area_ceiling);
23411 __tmp.put_f32_le(self.area_floor);
23412 __tmp.put_f32_le(self.operator_altitude_geo);
23413 __tmp.put_u32_le(self.timestamp);
23414 __tmp.put_u16_le(self.area_count);
23415 __tmp.put_u16_le(self.area_radius);
23416 __tmp.put_u8(self.target_system);
23417 __tmp.put_u8(self.target_component);
23418 for val in &self.id_or_mac {
23419 __tmp.put_u8(*val);
23420 }
23421 __tmp.put_u8(self.operator_location_type as u8);
23422 __tmp.put_u8(self.classification_type as u8);
23423 __tmp.put_u8(self.category_eu as u8);
23424 __tmp.put_u8(self.class_eu as u8);
23425 if matches!(version, MavlinkVersion::V2) {
23426 let len = __tmp.len();
23427 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23428 } else {
23429 __tmp.len()
23430 }
23431 }
23432}
23433#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
23434#[doc = ""]
23435#[doc = "ID: 12919"]
23436#[derive(Debug, Clone, PartialEq)]
23437#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23438#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23439#[cfg_attr(feature = "ts", derive(TS))]
23440#[cfg_attr(feature = "ts", ts(export))]
23441pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23442 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
23443 pub operator_latitude: i32,
23444 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
23445 pub operator_longitude: i32,
23446 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
23447 pub operator_altitude_geo: f32,
23448 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
23449 pub timestamp: u32,
23450 #[doc = "System ID (0 for broadcast)."]
23451 pub target_system: u8,
23452 #[doc = "Component ID (0 for broadcast)."]
23453 pub target_component: u8,
23454}
23455impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23456 pub const ENCODED_LEN: usize = 18usize;
23457 pub const DEFAULT: Self = Self {
23458 operator_latitude: 0_i32,
23459 operator_longitude: 0_i32,
23460 operator_altitude_geo: 0.0_f32,
23461 timestamp: 0_u32,
23462 target_system: 0_u8,
23463 target_component: 0_u8,
23464 };
23465 #[cfg(feature = "arbitrary")]
23466 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23467 use arbitrary::{Arbitrary, Unstructured};
23468 let mut buf = [0u8; 1024];
23469 rng.fill_bytes(&mut buf);
23470 let mut unstructured = Unstructured::new(&buf);
23471 Self::arbitrary(&mut unstructured).unwrap_or_default()
23472 }
23473}
23474impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23475 fn default() -> Self {
23476 Self::DEFAULT.clone()
23477 }
23478}
23479impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
23480 type Message = MavMessage;
23481 const ID: u32 = 12919u32;
23482 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
23483 const EXTRA_CRC: u8 = 7u8;
23484 const ENCODED_LEN: usize = 18usize;
23485 fn deser(
23486 _version: MavlinkVersion,
23487 __input: &[u8],
23488 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23489 let avail_len = __input.len();
23490 let mut payload_buf = [0; Self::ENCODED_LEN];
23491 let mut buf = if avail_len < Self::ENCODED_LEN {
23492 payload_buf[0..avail_len].copy_from_slice(__input);
23493 Bytes::new(&payload_buf)
23494 } else {
23495 Bytes::new(__input)
23496 };
23497 let mut __struct = Self::default();
23498 __struct.operator_latitude = buf.get_i32_le()?;
23499 __struct.operator_longitude = buf.get_i32_le()?;
23500 __struct.operator_altitude_geo = buf.get_f32_le()?;
23501 __struct.timestamp = buf.get_u32_le()?;
23502 __struct.target_system = buf.get_u8()?;
23503 __struct.target_component = buf.get_u8()?;
23504 Ok(__struct)
23505 }
23506 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23507 let mut __tmp = BytesMut::new(bytes);
23508 #[allow(clippy::absurd_extreme_comparisons)]
23509 #[allow(unused_comparisons)]
23510 if __tmp.remaining() < Self::ENCODED_LEN {
23511 panic!(
23512 "buffer is too small (need {} bytes, but got {})",
23513 Self::ENCODED_LEN,
23514 __tmp.remaining(),
23515 )
23516 }
23517 __tmp.put_i32_le(self.operator_latitude);
23518 __tmp.put_i32_le(self.operator_longitude);
23519 __tmp.put_f32_le(self.operator_altitude_geo);
23520 __tmp.put_u32_le(self.timestamp);
23521 __tmp.put_u8(self.target_system);
23522 __tmp.put_u8(self.target_component);
23523 if matches!(version, MavlinkVersion::V2) {
23524 let len = __tmp.len();
23525 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23526 } else {
23527 __tmp.len()
23528 }
23529 }
23530}
23531#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
23532#[doc = ""]
23533#[doc = "ID: 100"]
23534#[derive(Debug, Clone, PartialEq)]
23535#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23536#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23537#[cfg_attr(feature = "ts", derive(TS))]
23538#[cfg_attr(feature = "ts", ts(export))]
23539pub struct OPTICAL_FLOW_DATA {
23540 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23541 pub time_usec: u64,
23542 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
23543 pub flow_comp_m_x: f32,
23544 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
23545 pub flow_comp_m_y: f32,
23546 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
23547 pub ground_distance: f32,
23548 #[doc = "Flow in x-sensor direction"]
23549 pub flow_x: i16,
23550 #[doc = "Flow in y-sensor direction"]
23551 pub flow_y: i16,
23552 #[doc = "Sensor ID"]
23553 pub sensor_id: u8,
23554 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
23555 pub quality: u8,
23556 #[doc = "Flow rate about X axis"]
23557 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23558 pub flow_rate_x: f32,
23559 #[doc = "Flow rate about Y axis"]
23560 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23561 pub flow_rate_y: f32,
23562}
23563impl OPTICAL_FLOW_DATA {
23564 pub const ENCODED_LEN: usize = 34usize;
23565 pub const DEFAULT: Self = Self {
23566 time_usec: 0_u64,
23567 flow_comp_m_x: 0.0_f32,
23568 flow_comp_m_y: 0.0_f32,
23569 ground_distance: 0.0_f32,
23570 flow_x: 0_i16,
23571 flow_y: 0_i16,
23572 sensor_id: 0_u8,
23573 quality: 0_u8,
23574 flow_rate_x: 0.0_f32,
23575 flow_rate_y: 0.0_f32,
23576 };
23577 #[cfg(feature = "arbitrary")]
23578 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23579 use arbitrary::{Arbitrary, Unstructured};
23580 let mut buf = [0u8; 1024];
23581 rng.fill_bytes(&mut buf);
23582 let mut unstructured = Unstructured::new(&buf);
23583 Self::arbitrary(&mut unstructured).unwrap_or_default()
23584 }
23585}
23586impl Default for OPTICAL_FLOW_DATA {
23587 fn default() -> Self {
23588 Self::DEFAULT.clone()
23589 }
23590}
23591impl MessageData for OPTICAL_FLOW_DATA {
23592 type Message = MavMessage;
23593 const ID: u32 = 100u32;
23594 const NAME: &'static str = "OPTICAL_FLOW";
23595 const EXTRA_CRC: u8 = 175u8;
23596 const ENCODED_LEN: usize = 34usize;
23597 fn deser(
23598 _version: MavlinkVersion,
23599 __input: &[u8],
23600 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23601 let avail_len = __input.len();
23602 let mut payload_buf = [0; Self::ENCODED_LEN];
23603 let mut buf = if avail_len < Self::ENCODED_LEN {
23604 payload_buf[0..avail_len].copy_from_slice(__input);
23605 Bytes::new(&payload_buf)
23606 } else {
23607 Bytes::new(__input)
23608 };
23609 let mut __struct = Self::default();
23610 __struct.time_usec = buf.get_u64_le()?;
23611 __struct.flow_comp_m_x = buf.get_f32_le()?;
23612 __struct.flow_comp_m_y = buf.get_f32_le()?;
23613 __struct.ground_distance = buf.get_f32_le()?;
23614 __struct.flow_x = buf.get_i16_le()?;
23615 __struct.flow_y = buf.get_i16_le()?;
23616 __struct.sensor_id = buf.get_u8()?;
23617 __struct.quality = buf.get_u8()?;
23618 __struct.flow_rate_x = buf.get_f32_le()?;
23619 __struct.flow_rate_y = buf.get_f32_le()?;
23620 Ok(__struct)
23621 }
23622 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23623 let mut __tmp = BytesMut::new(bytes);
23624 #[allow(clippy::absurd_extreme_comparisons)]
23625 #[allow(unused_comparisons)]
23626 if __tmp.remaining() < Self::ENCODED_LEN {
23627 panic!(
23628 "buffer is too small (need {} bytes, but got {})",
23629 Self::ENCODED_LEN,
23630 __tmp.remaining(),
23631 )
23632 }
23633 __tmp.put_u64_le(self.time_usec);
23634 __tmp.put_f32_le(self.flow_comp_m_x);
23635 __tmp.put_f32_le(self.flow_comp_m_y);
23636 __tmp.put_f32_le(self.ground_distance);
23637 __tmp.put_i16_le(self.flow_x);
23638 __tmp.put_i16_le(self.flow_y);
23639 __tmp.put_u8(self.sensor_id);
23640 __tmp.put_u8(self.quality);
23641 if matches!(version, MavlinkVersion::V2) {
23642 __tmp.put_f32_le(self.flow_rate_x);
23643 __tmp.put_f32_le(self.flow_rate_y);
23644 let len = __tmp.len();
23645 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23646 } else {
23647 __tmp.len()
23648 }
23649 }
23650}
23651#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
23652#[doc = ""]
23653#[doc = "ID: 106"]
23654#[derive(Debug, Clone, PartialEq)]
23655#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23656#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23657#[cfg_attr(feature = "ts", derive(TS))]
23658#[cfg_attr(feature = "ts", ts(export))]
23659pub struct OPTICAL_FLOW_RAD_DATA {
23660 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23661 pub time_usec: u64,
23662 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
23663 pub integration_time_us: u32,
23664 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
23665 pub integrated_x: f32,
23666 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
23667 pub integrated_y: f32,
23668 #[doc = "RH rotation around X axis"]
23669 pub integrated_xgyro: f32,
23670 #[doc = "RH rotation around Y axis"]
23671 pub integrated_ygyro: f32,
23672 #[doc = "RH rotation around Z axis"]
23673 pub integrated_zgyro: f32,
23674 #[doc = "Time since the distance was sampled."]
23675 pub time_delta_distance_us: u32,
23676 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
23677 pub distance: f32,
23678 #[doc = "Temperature"]
23679 pub temperature: i16,
23680 #[doc = "Sensor ID"]
23681 pub sensor_id: u8,
23682 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
23683 pub quality: u8,
23684}
23685impl OPTICAL_FLOW_RAD_DATA {
23686 pub const ENCODED_LEN: usize = 44usize;
23687 pub const DEFAULT: Self = Self {
23688 time_usec: 0_u64,
23689 integration_time_us: 0_u32,
23690 integrated_x: 0.0_f32,
23691 integrated_y: 0.0_f32,
23692 integrated_xgyro: 0.0_f32,
23693 integrated_ygyro: 0.0_f32,
23694 integrated_zgyro: 0.0_f32,
23695 time_delta_distance_us: 0_u32,
23696 distance: 0.0_f32,
23697 temperature: 0_i16,
23698 sensor_id: 0_u8,
23699 quality: 0_u8,
23700 };
23701 #[cfg(feature = "arbitrary")]
23702 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23703 use arbitrary::{Arbitrary, Unstructured};
23704 let mut buf = [0u8; 1024];
23705 rng.fill_bytes(&mut buf);
23706 let mut unstructured = Unstructured::new(&buf);
23707 Self::arbitrary(&mut unstructured).unwrap_or_default()
23708 }
23709}
23710impl Default for OPTICAL_FLOW_RAD_DATA {
23711 fn default() -> Self {
23712 Self::DEFAULT.clone()
23713 }
23714}
23715impl MessageData for OPTICAL_FLOW_RAD_DATA {
23716 type Message = MavMessage;
23717 const ID: u32 = 106u32;
23718 const NAME: &'static str = "OPTICAL_FLOW_RAD";
23719 const EXTRA_CRC: u8 = 138u8;
23720 const ENCODED_LEN: usize = 44usize;
23721 fn deser(
23722 _version: MavlinkVersion,
23723 __input: &[u8],
23724 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23725 let avail_len = __input.len();
23726 let mut payload_buf = [0; Self::ENCODED_LEN];
23727 let mut buf = if avail_len < Self::ENCODED_LEN {
23728 payload_buf[0..avail_len].copy_from_slice(__input);
23729 Bytes::new(&payload_buf)
23730 } else {
23731 Bytes::new(__input)
23732 };
23733 let mut __struct = Self::default();
23734 __struct.time_usec = buf.get_u64_le()?;
23735 __struct.integration_time_us = buf.get_u32_le()?;
23736 __struct.integrated_x = buf.get_f32_le()?;
23737 __struct.integrated_y = buf.get_f32_le()?;
23738 __struct.integrated_xgyro = buf.get_f32_le()?;
23739 __struct.integrated_ygyro = buf.get_f32_le()?;
23740 __struct.integrated_zgyro = buf.get_f32_le()?;
23741 __struct.time_delta_distance_us = buf.get_u32_le()?;
23742 __struct.distance = buf.get_f32_le()?;
23743 __struct.temperature = buf.get_i16_le()?;
23744 __struct.sensor_id = buf.get_u8()?;
23745 __struct.quality = buf.get_u8()?;
23746 Ok(__struct)
23747 }
23748 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23749 let mut __tmp = BytesMut::new(bytes);
23750 #[allow(clippy::absurd_extreme_comparisons)]
23751 #[allow(unused_comparisons)]
23752 if __tmp.remaining() < Self::ENCODED_LEN {
23753 panic!(
23754 "buffer is too small (need {} bytes, but got {})",
23755 Self::ENCODED_LEN,
23756 __tmp.remaining(),
23757 )
23758 }
23759 __tmp.put_u64_le(self.time_usec);
23760 __tmp.put_u32_le(self.integration_time_us);
23761 __tmp.put_f32_le(self.integrated_x);
23762 __tmp.put_f32_le(self.integrated_y);
23763 __tmp.put_f32_le(self.integrated_xgyro);
23764 __tmp.put_f32_le(self.integrated_ygyro);
23765 __tmp.put_f32_le(self.integrated_zgyro);
23766 __tmp.put_u32_le(self.time_delta_distance_us);
23767 __tmp.put_f32_le(self.distance);
23768 __tmp.put_i16_le(self.temperature);
23769 __tmp.put_u8(self.sensor_id);
23770 __tmp.put_u8(self.quality);
23771 if matches!(version, MavlinkVersion::V2) {
23772 let len = __tmp.len();
23773 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23774 } else {
23775 __tmp.len()
23776 }
23777 }
23778}
23779#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
23780#[doc = ""]
23781#[doc = "ID: 360"]
23782#[derive(Debug, Clone, PartialEq)]
23783#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23784#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23785#[cfg_attr(feature = "ts", derive(TS))]
23786#[cfg_attr(feature = "ts", ts(export))]
23787pub struct ORBIT_EXECUTION_STATUS_DATA {
23788 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23789 pub time_usec: u64,
23790 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
23791 pub radius: f32,
23792 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23793 pub x: i32,
23794 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
23795 pub y: i32,
23796 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
23797 pub z: f32,
23798 #[doc = "The coordinate system of the fields: x, y, z."]
23799 pub frame: MavFrame,
23800}
23801impl ORBIT_EXECUTION_STATUS_DATA {
23802 pub const ENCODED_LEN: usize = 25usize;
23803 pub const DEFAULT: Self = Self {
23804 time_usec: 0_u64,
23805 radius: 0.0_f32,
23806 x: 0_i32,
23807 y: 0_i32,
23808 z: 0.0_f32,
23809 frame: MavFrame::DEFAULT,
23810 };
23811 #[cfg(feature = "arbitrary")]
23812 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23813 use arbitrary::{Arbitrary, Unstructured};
23814 let mut buf = [0u8; 1024];
23815 rng.fill_bytes(&mut buf);
23816 let mut unstructured = Unstructured::new(&buf);
23817 Self::arbitrary(&mut unstructured).unwrap_or_default()
23818 }
23819}
23820impl Default for ORBIT_EXECUTION_STATUS_DATA {
23821 fn default() -> Self {
23822 Self::DEFAULT.clone()
23823 }
23824}
23825impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
23826 type Message = MavMessage;
23827 const ID: u32 = 360u32;
23828 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
23829 const EXTRA_CRC: u8 = 11u8;
23830 const ENCODED_LEN: usize = 25usize;
23831 fn deser(
23832 _version: MavlinkVersion,
23833 __input: &[u8],
23834 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23835 let avail_len = __input.len();
23836 let mut payload_buf = [0; Self::ENCODED_LEN];
23837 let mut buf = if avail_len < Self::ENCODED_LEN {
23838 payload_buf[0..avail_len].copy_from_slice(__input);
23839 Bytes::new(&payload_buf)
23840 } else {
23841 Bytes::new(__input)
23842 };
23843 let mut __struct = Self::default();
23844 __struct.time_usec = buf.get_u64_le()?;
23845 __struct.radius = buf.get_f32_le()?;
23846 __struct.x = buf.get_i32_le()?;
23847 __struct.y = buf.get_i32_le()?;
23848 __struct.z = buf.get_f32_le()?;
23849 let tmp = buf.get_u8()?;
23850 __struct.frame =
23851 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23852 enum_type: "MavFrame",
23853 value: tmp as u64,
23854 })?;
23855 Ok(__struct)
23856 }
23857 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23858 let mut __tmp = BytesMut::new(bytes);
23859 #[allow(clippy::absurd_extreme_comparisons)]
23860 #[allow(unused_comparisons)]
23861 if __tmp.remaining() < Self::ENCODED_LEN {
23862 panic!(
23863 "buffer is too small (need {} bytes, but got {})",
23864 Self::ENCODED_LEN,
23865 __tmp.remaining(),
23866 )
23867 }
23868 __tmp.put_u64_le(self.time_usec);
23869 __tmp.put_f32_le(self.radius);
23870 __tmp.put_i32_le(self.x);
23871 __tmp.put_i32_le(self.y);
23872 __tmp.put_f32_le(self.z);
23873 __tmp.put_u8(self.frame as u8);
23874 if matches!(version, MavlinkVersion::V2) {
23875 let len = __tmp.len();
23876 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23877 } else {
23878 __tmp.len()
23879 }
23880 }
23881}
23882#[doc = "Response from a PARAM_EXT_SET message."]
23883#[doc = ""]
23884#[doc = "ID: 324"]
23885#[derive(Debug, Clone, PartialEq)]
23886#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23887#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23888#[cfg_attr(feature = "ts", derive(TS))]
23889#[cfg_attr(feature = "ts", ts(export))]
23890pub struct PARAM_EXT_ACK_DATA {
23891 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23892 #[cfg_attr(feature = "ts", ts(type = "string"))]
23893 pub param_id: CharArray<16>,
23894 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
23895 #[cfg_attr(feature = "ts", ts(type = "string"))]
23896 pub param_value: CharArray<128>,
23897 #[doc = "Parameter type."]
23898 pub param_type: MavParamExtType,
23899 #[doc = "Result code."]
23900 pub param_result: ParamAck,
23901}
23902impl PARAM_EXT_ACK_DATA {
23903 pub const ENCODED_LEN: usize = 146usize;
23904 pub const DEFAULT: Self = Self {
23905 param_id: CharArray::new([0_u8; 16usize]),
23906 param_value: CharArray::new([0_u8; 128usize]),
23907 param_type: MavParamExtType::DEFAULT,
23908 param_result: ParamAck::DEFAULT,
23909 };
23910 #[cfg(feature = "arbitrary")]
23911 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23912 use arbitrary::{Arbitrary, Unstructured};
23913 let mut buf = [0u8; 1024];
23914 rng.fill_bytes(&mut buf);
23915 let mut unstructured = Unstructured::new(&buf);
23916 Self::arbitrary(&mut unstructured).unwrap_or_default()
23917 }
23918}
23919impl Default for PARAM_EXT_ACK_DATA {
23920 fn default() -> Self {
23921 Self::DEFAULT.clone()
23922 }
23923}
23924impl MessageData for PARAM_EXT_ACK_DATA {
23925 type Message = MavMessage;
23926 const ID: u32 = 324u32;
23927 const NAME: &'static str = "PARAM_EXT_ACK";
23928 const EXTRA_CRC: u8 = 132u8;
23929 const ENCODED_LEN: usize = 146usize;
23930 fn deser(
23931 _version: MavlinkVersion,
23932 __input: &[u8],
23933 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23934 let avail_len = __input.len();
23935 let mut payload_buf = [0; Self::ENCODED_LEN];
23936 let mut buf = if avail_len < Self::ENCODED_LEN {
23937 payload_buf[0..avail_len].copy_from_slice(__input);
23938 Bytes::new(&payload_buf)
23939 } else {
23940 Bytes::new(__input)
23941 };
23942 let mut __struct = Self::default();
23943 let mut tmp = [0_u8; 16usize];
23944 for v in &mut tmp {
23945 *v = buf.get_u8()?;
23946 }
23947 __struct.param_id = CharArray::new(tmp);
23948 let mut tmp = [0_u8; 128usize];
23949 for v in &mut tmp {
23950 *v = buf.get_u8()?;
23951 }
23952 __struct.param_value = CharArray::new(tmp);
23953 let tmp = buf.get_u8()?;
23954 __struct.param_type =
23955 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23956 enum_type: "MavParamExtType",
23957 value: tmp as u64,
23958 })?;
23959 let tmp = buf.get_u8()?;
23960 __struct.param_result =
23961 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23962 enum_type: "ParamAck",
23963 value: tmp as u64,
23964 })?;
23965 Ok(__struct)
23966 }
23967 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23968 let mut __tmp = BytesMut::new(bytes);
23969 #[allow(clippy::absurd_extreme_comparisons)]
23970 #[allow(unused_comparisons)]
23971 if __tmp.remaining() < Self::ENCODED_LEN {
23972 panic!(
23973 "buffer is too small (need {} bytes, but got {})",
23974 Self::ENCODED_LEN,
23975 __tmp.remaining(),
23976 )
23977 }
23978 for val in &self.param_id {
23979 __tmp.put_u8(*val);
23980 }
23981 for val in &self.param_value {
23982 __tmp.put_u8(*val);
23983 }
23984 __tmp.put_u8(self.param_type as u8);
23985 __tmp.put_u8(self.param_result as u8);
23986 if matches!(version, MavlinkVersion::V2) {
23987 let len = __tmp.len();
23988 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23989 } else {
23990 __tmp.len()
23991 }
23992 }
23993}
23994#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
23995#[doc = ""]
23996#[doc = "ID: 321"]
23997#[derive(Debug, Clone, PartialEq)]
23998#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23999#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24000#[cfg_attr(feature = "ts", derive(TS))]
24001#[cfg_attr(feature = "ts", ts(export))]
24002pub struct PARAM_EXT_REQUEST_LIST_DATA {
24003 #[doc = "System ID"]
24004 pub target_system: u8,
24005 #[doc = "Component ID"]
24006 pub target_component: u8,
24007}
24008impl PARAM_EXT_REQUEST_LIST_DATA {
24009 pub const ENCODED_LEN: usize = 2usize;
24010 pub const DEFAULT: Self = Self {
24011 target_system: 0_u8,
24012 target_component: 0_u8,
24013 };
24014 #[cfg(feature = "arbitrary")]
24015 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24016 use arbitrary::{Arbitrary, Unstructured};
24017 let mut buf = [0u8; 1024];
24018 rng.fill_bytes(&mut buf);
24019 let mut unstructured = Unstructured::new(&buf);
24020 Self::arbitrary(&mut unstructured).unwrap_or_default()
24021 }
24022}
24023impl Default for PARAM_EXT_REQUEST_LIST_DATA {
24024 fn default() -> Self {
24025 Self::DEFAULT.clone()
24026 }
24027}
24028impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
24029 type Message = MavMessage;
24030 const ID: u32 = 321u32;
24031 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
24032 const EXTRA_CRC: u8 = 88u8;
24033 const ENCODED_LEN: usize = 2usize;
24034 fn deser(
24035 _version: MavlinkVersion,
24036 __input: &[u8],
24037 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24038 let avail_len = __input.len();
24039 let mut payload_buf = [0; Self::ENCODED_LEN];
24040 let mut buf = if avail_len < Self::ENCODED_LEN {
24041 payload_buf[0..avail_len].copy_from_slice(__input);
24042 Bytes::new(&payload_buf)
24043 } else {
24044 Bytes::new(__input)
24045 };
24046 let mut __struct = Self::default();
24047 __struct.target_system = buf.get_u8()?;
24048 __struct.target_component = buf.get_u8()?;
24049 Ok(__struct)
24050 }
24051 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24052 let mut __tmp = BytesMut::new(bytes);
24053 #[allow(clippy::absurd_extreme_comparisons)]
24054 #[allow(unused_comparisons)]
24055 if __tmp.remaining() < Self::ENCODED_LEN {
24056 panic!(
24057 "buffer is too small (need {} bytes, but got {})",
24058 Self::ENCODED_LEN,
24059 __tmp.remaining(),
24060 )
24061 }
24062 __tmp.put_u8(self.target_system);
24063 __tmp.put_u8(self.target_component);
24064 if matches!(version, MavlinkVersion::V2) {
24065 let len = __tmp.len();
24066 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24067 } else {
24068 __tmp.len()
24069 }
24070 }
24071}
24072#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
24073#[doc = ""]
24074#[doc = "ID: 320"]
24075#[derive(Debug, Clone, PartialEq)]
24076#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24077#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24078#[cfg_attr(feature = "ts", derive(TS))]
24079#[cfg_attr(feature = "ts", ts(export))]
24080pub struct PARAM_EXT_REQUEST_READ_DATA {
24081 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
24082 pub param_index: i16,
24083 #[doc = "System ID"]
24084 pub target_system: u8,
24085 #[doc = "Component ID"]
24086 pub target_component: u8,
24087 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24088 #[cfg_attr(feature = "ts", ts(type = "string"))]
24089 pub param_id: CharArray<16>,
24090}
24091impl PARAM_EXT_REQUEST_READ_DATA {
24092 pub const ENCODED_LEN: usize = 20usize;
24093 pub const DEFAULT: Self = Self {
24094 param_index: 0_i16,
24095 target_system: 0_u8,
24096 target_component: 0_u8,
24097 param_id: CharArray::new([0_u8; 16usize]),
24098 };
24099 #[cfg(feature = "arbitrary")]
24100 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24101 use arbitrary::{Arbitrary, Unstructured};
24102 let mut buf = [0u8; 1024];
24103 rng.fill_bytes(&mut buf);
24104 let mut unstructured = Unstructured::new(&buf);
24105 Self::arbitrary(&mut unstructured).unwrap_or_default()
24106 }
24107}
24108impl Default for PARAM_EXT_REQUEST_READ_DATA {
24109 fn default() -> Self {
24110 Self::DEFAULT.clone()
24111 }
24112}
24113impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
24114 type Message = MavMessage;
24115 const ID: u32 = 320u32;
24116 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
24117 const EXTRA_CRC: u8 = 243u8;
24118 const ENCODED_LEN: usize = 20usize;
24119 fn deser(
24120 _version: MavlinkVersion,
24121 __input: &[u8],
24122 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24123 let avail_len = __input.len();
24124 let mut payload_buf = [0; Self::ENCODED_LEN];
24125 let mut buf = if avail_len < Self::ENCODED_LEN {
24126 payload_buf[0..avail_len].copy_from_slice(__input);
24127 Bytes::new(&payload_buf)
24128 } else {
24129 Bytes::new(__input)
24130 };
24131 let mut __struct = Self::default();
24132 __struct.param_index = buf.get_i16_le()?;
24133 __struct.target_system = buf.get_u8()?;
24134 __struct.target_component = buf.get_u8()?;
24135 let mut tmp = [0_u8; 16usize];
24136 for v in &mut tmp {
24137 *v = buf.get_u8()?;
24138 }
24139 __struct.param_id = CharArray::new(tmp);
24140 Ok(__struct)
24141 }
24142 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24143 let mut __tmp = BytesMut::new(bytes);
24144 #[allow(clippy::absurd_extreme_comparisons)]
24145 #[allow(unused_comparisons)]
24146 if __tmp.remaining() < Self::ENCODED_LEN {
24147 panic!(
24148 "buffer is too small (need {} bytes, but got {})",
24149 Self::ENCODED_LEN,
24150 __tmp.remaining(),
24151 )
24152 }
24153 __tmp.put_i16_le(self.param_index);
24154 __tmp.put_u8(self.target_system);
24155 __tmp.put_u8(self.target_component);
24156 for val in &self.param_id {
24157 __tmp.put_u8(*val);
24158 }
24159 if matches!(version, MavlinkVersion::V2) {
24160 let len = __tmp.len();
24161 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24162 } else {
24163 __tmp.len()
24164 }
24165 }
24166}
24167#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
24168#[doc = ""]
24169#[doc = "ID: 323"]
24170#[derive(Debug, Clone, PartialEq)]
24171#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24172#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24173#[cfg_attr(feature = "ts", derive(TS))]
24174#[cfg_attr(feature = "ts", ts(export))]
24175pub struct PARAM_EXT_SET_DATA {
24176 #[doc = "System ID"]
24177 pub target_system: u8,
24178 #[doc = "Component ID"]
24179 pub target_component: u8,
24180 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24181 #[cfg_attr(feature = "ts", ts(type = "string"))]
24182 pub param_id: CharArray<16>,
24183 #[doc = "Parameter value"]
24184 #[cfg_attr(feature = "ts", ts(type = "string"))]
24185 pub param_value: CharArray<128>,
24186 #[doc = "Parameter type."]
24187 pub param_type: MavParamExtType,
24188}
24189impl PARAM_EXT_SET_DATA {
24190 pub const ENCODED_LEN: usize = 147usize;
24191 pub const DEFAULT: Self = Self {
24192 target_system: 0_u8,
24193 target_component: 0_u8,
24194 param_id: CharArray::new([0_u8; 16usize]),
24195 param_value: CharArray::new([0_u8; 128usize]),
24196 param_type: MavParamExtType::DEFAULT,
24197 };
24198 #[cfg(feature = "arbitrary")]
24199 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24200 use arbitrary::{Arbitrary, Unstructured};
24201 let mut buf = [0u8; 1024];
24202 rng.fill_bytes(&mut buf);
24203 let mut unstructured = Unstructured::new(&buf);
24204 Self::arbitrary(&mut unstructured).unwrap_or_default()
24205 }
24206}
24207impl Default for PARAM_EXT_SET_DATA {
24208 fn default() -> Self {
24209 Self::DEFAULT.clone()
24210 }
24211}
24212impl MessageData for PARAM_EXT_SET_DATA {
24213 type Message = MavMessage;
24214 const ID: u32 = 323u32;
24215 const NAME: &'static str = "PARAM_EXT_SET";
24216 const EXTRA_CRC: u8 = 78u8;
24217 const ENCODED_LEN: usize = 147usize;
24218 fn deser(
24219 _version: MavlinkVersion,
24220 __input: &[u8],
24221 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24222 let avail_len = __input.len();
24223 let mut payload_buf = [0; Self::ENCODED_LEN];
24224 let mut buf = if avail_len < Self::ENCODED_LEN {
24225 payload_buf[0..avail_len].copy_from_slice(__input);
24226 Bytes::new(&payload_buf)
24227 } else {
24228 Bytes::new(__input)
24229 };
24230 let mut __struct = Self::default();
24231 __struct.target_system = buf.get_u8()?;
24232 __struct.target_component = buf.get_u8()?;
24233 let mut tmp = [0_u8; 16usize];
24234 for v in &mut tmp {
24235 *v = buf.get_u8()?;
24236 }
24237 __struct.param_id = CharArray::new(tmp);
24238 let mut tmp = [0_u8; 128usize];
24239 for v in &mut tmp {
24240 *v = buf.get_u8()?;
24241 }
24242 __struct.param_value = CharArray::new(tmp);
24243 let tmp = buf.get_u8()?;
24244 __struct.param_type =
24245 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24246 enum_type: "MavParamExtType",
24247 value: tmp as u64,
24248 })?;
24249 Ok(__struct)
24250 }
24251 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24252 let mut __tmp = BytesMut::new(bytes);
24253 #[allow(clippy::absurd_extreme_comparisons)]
24254 #[allow(unused_comparisons)]
24255 if __tmp.remaining() < Self::ENCODED_LEN {
24256 panic!(
24257 "buffer is too small (need {} bytes, but got {})",
24258 Self::ENCODED_LEN,
24259 __tmp.remaining(),
24260 )
24261 }
24262 __tmp.put_u8(self.target_system);
24263 __tmp.put_u8(self.target_component);
24264 for val in &self.param_id {
24265 __tmp.put_u8(*val);
24266 }
24267 for val in &self.param_value {
24268 __tmp.put_u8(*val);
24269 }
24270 __tmp.put_u8(self.param_type as u8);
24271 if matches!(version, MavlinkVersion::V2) {
24272 let len = __tmp.len();
24273 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24274 } else {
24275 __tmp.len()
24276 }
24277 }
24278}
24279#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
24280#[doc = ""]
24281#[doc = "ID: 322"]
24282#[derive(Debug, Clone, PartialEq)]
24283#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24284#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24285#[cfg_attr(feature = "ts", derive(TS))]
24286#[cfg_attr(feature = "ts", ts(export))]
24287pub struct PARAM_EXT_VALUE_DATA {
24288 #[doc = "Total number of parameters"]
24289 pub param_count: u16,
24290 #[doc = "Index of this parameter"]
24291 pub param_index: u16,
24292 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24293 #[cfg_attr(feature = "ts", ts(type = "string"))]
24294 pub param_id: CharArray<16>,
24295 #[doc = "Parameter value"]
24296 #[cfg_attr(feature = "ts", ts(type = "string"))]
24297 pub param_value: CharArray<128>,
24298 #[doc = "Parameter type."]
24299 pub param_type: MavParamExtType,
24300}
24301impl PARAM_EXT_VALUE_DATA {
24302 pub const ENCODED_LEN: usize = 149usize;
24303 pub const DEFAULT: Self = Self {
24304 param_count: 0_u16,
24305 param_index: 0_u16,
24306 param_id: CharArray::new([0_u8; 16usize]),
24307 param_value: CharArray::new([0_u8; 128usize]),
24308 param_type: MavParamExtType::DEFAULT,
24309 };
24310 #[cfg(feature = "arbitrary")]
24311 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24312 use arbitrary::{Arbitrary, Unstructured};
24313 let mut buf = [0u8; 1024];
24314 rng.fill_bytes(&mut buf);
24315 let mut unstructured = Unstructured::new(&buf);
24316 Self::arbitrary(&mut unstructured).unwrap_or_default()
24317 }
24318}
24319impl Default for PARAM_EXT_VALUE_DATA {
24320 fn default() -> Self {
24321 Self::DEFAULT.clone()
24322 }
24323}
24324impl MessageData for PARAM_EXT_VALUE_DATA {
24325 type Message = MavMessage;
24326 const ID: u32 = 322u32;
24327 const NAME: &'static str = "PARAM_EXT_VALUE";
24328 const EXTRA_CRC: u8 = 243u8;
24329 const ENCODED_LEN: usize = 149usize;
24330 fn deser(
24331 _version: MavlinkVersion,
24332 __input: &[u8],
24333 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24334 let avail_len = __input.len();
24335 let mut payload_buf = [0; Self::ENCODED_LEN];
24336 let mut buf = if avail_len < Self::ENCODED_LEN {
24337 payload_buf[0..avail_len].copy_from_slice(__input);
24338 Bytes::new(&payload_buf)
24339 } else {
24340 Bytes::new(__input)
24341 };
24342 let mut __struct = Self::default();
24343 __struct.param_count = buf.get_u16_le()?;
24344 __struct.param_index = buf.get_u16_le()?;
24345 let mut tmp = [0_u8; 16usize];
24346 for v in &mut tmp {
24347 *v = buf.get_u8()?;
24348 }
24349 __struct.param_id = CharArray::new(tmp);
24350 let mut tmp = [0_u8; 128usize];
24351 for v in &mut tmp {
24352 *v = buf.get_u8()?;
24353 }
24354 __struct.param_value = CharArray::new(tmp);
24355 let tmp = buf.get_u8()?;
24356 __struct.param_type =
24357 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24358 enum_type: "MavParamExtType",
24359 value: tmp as u64,
24360 })?;
24361 Ok(__struct)
24362 }
24363 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24364 let mut __tmp = BytesMut::new(bytes);
24365 #[allow(clippy::absurd_extreme_comparisons)]
24366 #[allow(unused_comparisons)]
24367 if __tmp.remaining() < Self::ENCODED_LEN {
24368 panic!(
24369 "buffer is too small (need {} bytes, but got {})",
24370 Self::ENCODED_LEN,
24371 __tmp.remaining(),
24372 )
24373 }
24374 __tmp.put_u16_le(self.param_count);
24375 __tmp.put_u16_le(self.param_index);
24376 for val in &self.param_id {
24377 __tmp.put_u8(*val);
24378 }
24379 for val in &self.param_value {
24380 __tmp.put_u8(*val);
24381 }
24382 __tmp.put_u8(self.param_type as u8);
24383 if matches!(version, MavlinkVersion::V2) {
24384 let len = __tmp.len();
24385 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24386 } else {
24387 __tmp.len()
24388 }
24389 }
24390}
24391#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
24392#[doc = ""]
24393#[doc = "ID: 50"]
24394#[derive(Debug, Clone, PartialEq)]
24395#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24396#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24397#[cfg_attr(feature = "ts", derive(TS))]
24398#[cfg_attr(feature = "ts", ts(export))]
24399pub struct PARAM_MAP_RC_DATA {
24400 #[doc = "Initial parameter value"]
24401 pub param_value0: f32,
24402 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
24403 pub scale: f32,
24404 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
24405 pub param_value_min: f32,
24406 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
24407 pub param_value_max: f32,
24408 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
24409 pub param_index: i16,
24410 #[doc = "System ID"]
24411 pub target_system: u8,
24412 #[doc = "Component ID"]
24413 pub target_component: u8,
24414 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24415 #[cfg_attr(feature = "ts", ts(type = "string"))]
24416 pub param_id: CharArray<16>,
24417 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
24418 pub parameter_rc_channel_index: u8,
24419}
24420impl PARAM_MAP_RC_DATA {
24421 pub const ENCODED_LEN: usize = 37usize;
24422 pub const DEFAULT: Self = Self {
24423 param_value0: 0.0_f32,
24424 scale: 0.0_f32,
24425 param_value_min: 0.0_f32,
24426 param_value_max: 0.0_f32,
24427 param_index: 0_i16,
24428 target_system: 0_u8,
24429 target_component: 0_u8,
24430 param_id: CharArray::new([0_u8; 16usize]),
24431 parameter_rc_channel_index: 0_u8,
24432 };
24433 #[cfg(feature = "arbitrary")]
24434 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24435 use arbitrary::{Arbitrary, Unstructured};
24436 let mut buf = [0u8; 1024];
24437 rng.fill_bytes(&mut buf);
24438 let mut unstructured = Unstructured::new(&buf);
24439 Self::arbitrary(&mut unstructured).unwrap_or_default()
24440 }
24441}
24442impl Default for PARAM_MAP_RC_DATA {
24443 fn default() -> Self {
24444 Self::DEFAULT.clone()
24445 }
24446}
24447impl MessageData for PARAM_MAP_RC_DATA {
24448 type Message = MavMessage;
24449 const ID: u32 = 50u32;
24450 const NAME: &'static str = "PARAM_MAP_RC";
24451 const EXTRA_CRC: u8 = 78u8;
24452 const ENCODED_LEN: usize = 37usize;
24453 fn deser(
24454 _version: MavlinkVersion,
24455 __input: &[u8],
24456 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24457 let avail_len = __input.len();
24458 let mut payload_buf = [0; Self::ENCODED_LEN];
24459 let mut buf = if avail_len < Self::ENCODED_LEN {
24460 payload_buf[0..avail_len].copy_from_slice(__input);
24461 Bytes::new(&payload_buf)
24462 } else {
24463 Bytes::new(__input)
24464 };
24465 let mut __struct = Self::default();
24466 __struct.param_value0 = buf.get_f32_le()?;
24467 __struct.scale = buf.get_f32_le()?;
24468 __struct.param_value_min = buf.get_f32_le()?;
24469 __struct.param_value_max = buf.get_f32_le()?;
24470 __struct.param_index = buf.get_i16_le()?;
24471 __struct.target_system = buf.get_u8()?;
24472 __struct.target_component = buf.get_u8()?;
24473 let mut tmp = [0_u8; 16usize];
24474 for v in &mut tmp {
24475 *v = buf.get_u8()?;
24476 }
24477 __struct.param_id = CharArray::new(tmp);
24478 __struct.parameter_rc_channel_index = buf.get_u8()?;
24479 Ok(__struct)
24480 }
24481 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24482 let mut __tmp = BytesMut::new(bytes);
24483 #[allow(clippy::absurd_extreme_comparisons)]
24484 #[allow(unused_comparisons)]
24485 if __tmp.remaining() < Self::ENCODED_LEN {
24486 panic!(
24487 "buffer is too small (need {} bytes, but got {})",
24488 Self::ENCODED_LEN,
24489 __tmp.remaining(),
24490 )
24491 }
24492 __tmp.put_f32_le(self.param_value0);
24493 __tmp.put_f32_le(self.scale);
24494 __tmp.put_f32_le(self.param_value_min);
24495 __tmp.put_f32_le(self.param_value_max);
24496 __tmp.put_i16_le(self.param_index);
24497 __tmp.put_u8(self.target_system);
24498 __tmp.put_u8(self.target_component);
24499 for val in &self.param_id {
24500 __tmp.put_u8(*val);
24501 }
24502 __tmp.put_u8(self.parameter_rc_channel_index);
24503 if matches!(version, MavlinkVersion::V2) {
24504 let len = __tmp.len();
24505 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24506 } else {
24507 __tmp.len()
24508 }
24509 }
24510}
24511#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24512#[doc = ""]
24513#[doc = "ID: 21"]
24514#[derive(Debug, Clone, PartialEq)]
24515#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24516#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24517#[cfg_attr(feature = "ts", derive(TS))]
24518#[cfg_attr(feature = "ts", ts(export))]
24519pub struct PARAM_REQUEST_LIST_DATA {
24520 #[doc = "System ID"]
24521 pub target_system: u8,
24522 #[doc = "Component ID"]
24523 pub target_component: u8,
24524}
24525impl PARAM_REQUEST_LIST_DATA {
24526 pub const ENCODED_LEN: usize = 2usize;
24527 pub const DEFAULT: Self = Self {
24528 target_system: 0_u8,
24529 target_component: 0_u8,
24530 };
24531 #[cfg(feature = "arbitrary")]
24532 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24533 use arbitrary::{Arbitrary, Unstructured};
24534 let mut buf = [0u8; 1024];
24535 rng.fill_bytes(&mut buf);
24536 let mut unstructured = Unstructured::new(&buf);
24537 Self::arbitrary(&mut unstructured).unwrap_or_default()
24538 }
24539}
24540impl Default for PARAM_REQUEST_LIST_DATA {
24541 fn default() -> Self {
24542 Self::DEFAULT.clone()
24543 }
24544}
24545impl MessageData for PARAM_REQUEST_LIST_DATA {
24546 type Message = MavMessage;
24547 const ID: u32 = 21u32;
24548 const NAME: &'static str = "PARAM_REQUEST_LIST";
24549 const EXTRA_CRC: u8 = 159u8;
24550 const ENCODED_LEN: usize = 2usize;
24551 fn deser(
24552 _version: MavlinkVersion,
24553 __input: &[u8],
24554 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24555 let avail_len = __input.len();
24556 let mut payload_buf = [0; Self::ENCODED_LEN];
24557 let mut buf = if avail_len < Self::ENCODED_LEN {
24558 payload_buf[0..avail_len].copy_from_slice(__input);
24559 Bytes::new(&payload_buf)
24560 } else {
24561 Bytes::new(__input)
24562 };
24563 let mut __struct = Self::default();
24564 __struct.target_system = buf.get_u8()?;
24565 __struct.target_component = buf.get_u8()?;
24566 Ok(__struct)
24567 }
24568 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24569 let mut __tmp = BytesMut::new(bytes);
24570 #[allow(clippy::absurd_extreme_comparisons)]
24571 #[allow(unused_comparisons)]
24572 if __tmp.remaining() < Self::ENCODED_LEN {
24573 panic!(
24574 "buffer is too small (need {} bytes, but got {})",
24575 Self::ENCODED_LEN,
24576 __tmp.remaining(),
24577 )
24578 }
24579 __tmp.put_u8(self.target_system);
24580 __tmp.put_u8(self.target_component);
24581 if matches!(version, MavlinkVersion::V2) {
24582 let len = __tmp.len();
24583 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24584 } else {
24585 __tmp.len()
24586 }
24587 }
24588}
24589#[doc = "Request to read the onboard parameter with the param_id string id. Onboard parameters are stored as key[const char*] ->value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
24590#[doc = ""]
24591#[doc = "ID: 20"]
24592#[derive(Debug, Clone, PartialEq)]
24593#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24594#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24595#[cfg_attr(feature = "ts", derive(TS))]
24596#[cfg_attr(feature = "ts", ts(export))]
24597pub struct PARAM_REQUEST_READ_DATA {
24598 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
24599 pub param_index: i16,
24600 #[doc = "System ID"]
24601 pub target_system: u8,
24602 #[doc = "Component ID"]
24603 pub target_component: u8,
24604 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24605 #[cfg_attr(feature = "ts", ts(type = "string"))]
24606 pub param_id: CharArray<16>,
24607}
24608impl PARAM_REQUEST_READ_DATA {
24609 pub const ENCODED_LEN: usize = 20usize;
24610 pub const DEFAULT: Self = Self {
24611 param_index: 0_i16,
24612 target_system: 0_u8,
24613 target_component: 0_u8,
24614 param_id: CharArray::new([0_u8; 16usize]),
24615 };
24616 #[cfg(feature = "arbitrary")]
24617 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24618 use arbitrary::{Arbitrary, Unstructured};
24619 let mut buf = [0u8; 1024];
24620 rng.fill_bytes(&mut buf);
24621 let mut unstructured = Unstructured::new(&buf);
24622 Self::arbitrary(&mut unstructured).unwrap_or_default()
24623 }
24624}
24625impl Default for PARAM_REQUEST_READ_DATA {
24626 fn default() -> Self {
24627 Self::DEFAULT.clone()
24628 }
24629}
24630impl MessageData for PARAM_REQUEST_READ_DATA {
24631 type Message = MavMessage;
24632 const ID: u32 = 20u32;
24633 const NAME: &'static str = "PARAM_REQUEST_READ";
24634 const EXTRA_CRC: u8 = 214u8;
24635 const ENCODED_LEN: usize = 20usize;
24636 fn deser(
24637 _version: MavlinkVersion,
24638 __input: &[u8],
24639 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24640 let avail_len = __input.len();
24641 let mut payload_buf = [0; Self::ENCODED_LEN];
24642 let mut buf = if avail_len < Self::ENCODED_LEN {
24643 payload_buf[0..avail_len].copy_from_slice(__input);
24644 Bytes::new(&payload_buf)
24645 } else {
24646 Bytes::new(__input)
24647 };
24648 let mut __struct = Self::default();
24649 __struct.param_index = buf.get_i16_le()?;
24650 __struct.target_system = buf.get_u8()?;
24651 __struct.target_component = buf.get_u8()?;
24652 let mut tmp = [0_u8; 16usize];
24653 for v in &mut tmp {
24654 *v = buf.get_u8()?;
24655 }
24656 __struct.param_id = CharArray::new(tmp);
24657 Ok(__struct)
24658 }
24659 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24660 let mut __tmp = BytesMut::new(bytes);
24661 #[allow(clippy::absurd_extreme_comparisons)]
24662 #[allow(unused_comparisons)]
24663 if __tmp.remaining() < Self::ENCODED_LEN {
24664 panic!(
24665 "buffer is too small (need {} bytes, but got {})",
24666 Self::ENCODED_LEN,
24667 __tmp.remaining(),
24668 )
24669 }
24670 __tmp.put_i16_le(self.param_index);
24671 __tmp.put_u8(self.target_system);
24672 __tmp.put_u8(self.target_component);
24673 for val in &self.param_id {
24674 __tmp.put_u8(*val);
24675 }
24676 if matches!(version, MavlinkVersion::V2) {
24677 let len = __tmp.len();
24678 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24679 } else {
24680 __tmp.len()
24681 }
24682 }
24683}
24684#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24685#[doc = ""]
24686#[doc = "ID: 23"]
24687#[derive(Debug, Clone, PartialEq)]
24688#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24689#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24690#[cfg_attr(feature = "ts", derive(TS))]
24691#[cfg_attr(feature = "ts", ts(export))]
24692pub struct PARAM_SET_DATA {
24693 #[doc = "Onboard parameter value"]
24694 pub param_value: f32,
24695 #[doc = "System ID"]
24696 pub target_system: u8,
24697 #[doc = "Component ID"]
24698 pub target_component: u8,
24699 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24700 #[cfg_attr(feature = "ts", ts(type = "string"))]
24701 pub param_id: CharArray<16>,
24702 #[doc = "Onboard parameter type."]
24703 pub param_type: MavParamType,
24704}
24705impl PARAM_SET_DATA {
24706 pub const ENCODED_LEN: usize = 23usize;
24707 pub const DEFAULT: Self = Self {
24708 param_value: 0.0_f32,
24709 target_system: 0_u8,
24710 target_component: 0_u8,
24711 param_id: CharArray::new([0_u8; 16usize]),
24712 param_type: MavParamType::DEFAULT,
24713 };
24714 #[cfg(feature = "arbitrary")]
24715 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24716 use arbitrary::{Arbitrary, Unstructured};
24717 let mut buf = [0u8; 1024];
24718 rng.fill_bytes(&mut buf);
24719 let mut unstructured = Unstructured::new(&buf);
24720 Self::arbitrary(&mut unstructured).unwrap_or_default()
24721 }
24722}
24723impl Default for PARAM_SET_DATA {
24724 fn default() -> Self {
24725 Self::DEFAULT.clone()
24726 }
24727}
24728impl MessageData for PARAM_SET_DATA {
24729 type Message = MavMessage;
24730 const ID: u32 = 23u32;
24731 const NAME: &'static str = "PARAM_SET";
24732 const EXTRA_CRC: u8 = 168u8;
24733 const ENCODED_LEN: usize = 23usize;
24734 fn deser(
24735 _version: MavlinkVersion,
24736 __input: &[u8],
24737 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24738 let avail_len = __input.len();
24739 let mut payload_buf = [0; Self::ENCODED_LEN];
24740 let mut buf = if avail_len < Self::ENCODED_LEN {
24741 payload_buf[0..avail_len].copy_from_slice(__input);
24742 Bytes::new(&payload_buf)
24743 } else {
24744 Bytes::new(__input)
24745 };
24746 let mut __struct = Self::default();
24747 __struct.param_value = buf.get_f32_le()?;
24748 __struct.target_system = buf.get_u8()?;
24749 __struct.target_component = buf.get_u8()?;
24750 let mut tmp = [0_u8; 16usize];
24751 for v in &mut tmp {
24752 *v = buf.get_u8()?;
24753 }
24754 __struct.param_id = CharArray::new(tmp);
24755 let tmp = buf.get_u8()?;
24756 __struct.param_type =
24757 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24758 enum_type: "MavParamType",
24759 value: tmp as u64,
24760 })?;
24761 Ok(__struct)
24762 }
24763 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24764 let mut __tmp = BytesMut::new(bytes);
24765 #[allow(clippy::absurd_extreme_comparisons)]
24766 #[allow(unused_comparisons)]
24767 if __tmp.remaining() < Self::ENCODED_LEN {
24768 panic!(
24769 "buffer is too small (need {} bytes, but got {})",
24770 Self::ENCODED_LEN,
24771 __tmp.remaining(),
24772 )
24773 }
24774 __tmp.put_f32_le(self.param_value);
24775 __tmp.put_u8(self.target_system);
24776 __tmp.put_u8(self.target_component);
24777 for val in &self.param_id {
24778 __tmp.put_u8(*val);
24779 }
24780 __tmp.put_u8(self.param_type as u8);
24781 if matches!(version, MavlinkVersion::V2) {
24782 let len = __tmp.len();
24783 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24784 } else {
24785 __tmp.len()
24786 }
24787 }
24788}
24789#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
24790#[doc = ""]
24791#[doc = "ID: 22"]
24792#[derive(Debug, Clone, PartialEq)]
24793#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24794#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24795#[cfg_attr(feature = "ts", derive(TS))]
24796#[cfg_attr(feature = "ts", ts(export))]
24797pub struct PARAM_VALUE_DATA {
24798 #[doc = "Onboard parameter value"]
24799 pub param_value: f32,
24800 #[doc = "Total number of onboard parameters"]
24801 pub param_count: u16,
24802 #[doc = "Index of this onboard parameter"]
24803 pub param_index: u16,
24804 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
24805 #[cfg_attr(feature = "ts", ts(type = "string"))]
24806 pub param_id: CharArray<16>,
24807 #[doc = "Onboard parameter type."]
24808 pub param_type: MavParamType,
24809}
24810impl PARAM_VALUE_DATA {
24811 pub const ENCODED_LEN: usize = 25usize;
24812 pub const DEFAULT: Self = Self {
24813 param_value: 0.0_f32,
24814 param_count: 0_u16,
24815 param_index: 0_u16,
24816 param_id: CharArray::new([0_u8; 16usize]),
24817 param_type: MavParamType::DEFAULT,
24818 };
24819 #[cfg(feature = "arbitrary")]
24820 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24821 use arbitrary::{Arbitrary, Unstructured};
24822 let mut buf = [0u8; 1024];
24823 rng.fill_bytes(&mut buf);
24824 let mut unstructured = Unstructured::new(&buf);
24825 Self::arbitrary(&mut unstructured).unwrap_or_default()
24826 }
24827}
24828impl Default for PARAM_VALUE_DATA {
24829 fn default() -> Self {
24830 Self::DEFAULT.clone()
24831 }
24832}
24833impl MessageData for PARAM_VALUE_DATA {
24834 type Message = MavMessage;
24835 const ID: u32 = 22u32;
24836 const NAME: &'static str = "PARAM_VALUE";
24837 const EXTRA_CRC: u8 = 220u8;
24838 const ENCODED_LEN: usize = 25usize;
24839 fn deser(
24840 _version: MavlinkVersion,
24841 __input: &[u8],
24842 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24843 let avail_len = __input.len();
24844 let mut payload_buf = [0; Self::ENCODED_LEN];
24845 let mut buf = if avail_len < Self::ENCODED_LEN {
24846 payload_buf[0..avail_len].copy_from_slice(__input);
24847 Bytes::new(&payload_buf)
24848 } else {
24849 Bytes::new(__input)
24850 };
24851 let mut __struct = Self::default();
24852 __struct.param_value = buf.get_f32_le()?;
24853 __struct.param_count = buf.get_u16_le()?;
24854 __struct.param_index = buf.get_u16_le()?;
24855 let mut tmp = [0_u8; 16usize];
24856 for v in &mut tmp {
24857 *v = buf.get_u8()?;
24858 }
24859 __struct.param_id = CharArray::new(tmp);
24860 let tmp = buf.get_u8()?;
24861 __struct.param_type =
24862 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24863 enum_type: "MavParamType",
24864 value: tmp as u64,
24865 })?;
24866 Ok(__struct)
24867 }
24868 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24869 let mut __tmp = BytesMut::new(bytes);
24870 #[allow(clippy::absurd_extreme_comparisons)]
24871 #[allow(unused_comparisons)]
24872 if __tmp.remaining() < Self::ENCODED_LEN {
24873 panic!(
24874 "buffer is too small (need {} bytes, but got {})",
24875 Self::ENCODED_LEN,
24876 __tmp.remaining(),
24877 )
24878 }
24879 __tmp.put_f32_le(self.param_value);
24880 __tmp.put_u16_le(self.param_count);
24881 __tmp.put_u16_le(self.param_index);
24882 for val in &self.param_id {
24883 __tmp.put_u8(*val);
24884 }
24885 __tmp.put_u8(self.param_type as u8);
24886 if matches!(version, MavlinkVersion::V2) {
24887 let len = __tmp.len();
24888 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24889 } else {
24890 __tmp.len()
24891 }
24892 }
24893}
24894#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
24895#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
24896#[doc = ""]
24897#[doc = "ID: 4"]
24898#[derive(Debug, Clone, PartialEq)]
24899#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24900#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24901#[cfg_attr(feature = "ts", derive(TS))]
24902#[cfg_attr(feature = "ts", ts(export))]
24903pub struct PING_DATA {
24904 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24905 pub time_usec: u64,
24906 #[doc = "PING sequence"]
24907 pub seq: u32,
24908 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
24909 pub target_system: u8,
24910 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
24911 pub target_component: u8,
24912}
24913impl PING_DATA {
24914 pub const ENCODED_LEN: usize = 14usize;
24915 pub const DEFAULT: Self = Self {
24916 time_usec: 0_u64,
24917 seq: 0_u32,
24918 target_system: 0_u8,
24919 target_component: 0_u8,
24920 };
24921 #[cfg(feature = "arbitrary")]
24922 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24923 use arbitrary::{Arbitrary, Unstructured};
24924 let mut buf = [0u8; 1024];
24925 rng.fill_bytes(&mut buf);
24926 let mut unstructured = Unstructured::new(&buf);
24927 Self::arbitrary(&mut unstructured).unwrap_or_default()
24928 }
24929}
24930impl Default for PING_DATA {
24931 fn default() -> Self {
24932 Self::DEFAULT.clone()
24933 }
24934}
24935impl MessageData for PING_DATA {
24936 type Message = MavMessage;
24937 const ID: u32 = 4u32;
24938 const NAME: &'static str = "PING";
24939 const EXTRA_CRC: u8 = 237u8;
24940 const ENCODED_LEN: usize = 14usize;
24941 fn deser(
24942 _version: MavlinkVersion,
24943 __input: &[u8],
24944 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24945 let avail_len = __input.len();
24946 let mut payload_buf = [0; Self::ENCODED_LEN];
24947 let mut buf = if avail_len < Self::ENCODED_LEN {
24948 payload_buf[0..avail_len].copy_from_slice(__input);
24949 Bytes::new(&payload_buf)
24950 } else {
24951 Bytes::new(__input)
24952 };
24953 let mut __struct = Self::default();
24954 __struct.time_usec = buf.get_u64_le()?;
24955 __struct.seq = buf.get_u32_le()?;
24956 __struct.target_system = buf.get_u8()?;
24957 __struct.target_component = buf.get_u8()?;
24958 Ok(__struct)
24959 }
24960 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24961 let mut __tmp = BytesMut::new(bytes);
24962 #[allow(clippy::absurd_extreme_comparisons)]
24963 #[allow(unused_comparisons)]
24964 if __tmp.remaining() < Self::ENCODED_LEN {
24965 panic!(
24966 "buffer is too small (need {} bytes, but got {})",
24967 Self::ENCODED_LEN,
24968 __tmp.remaining(),
24969 )
24970 }
24971 __tmp.put_u64_le(self.time_usec);
24972 __tmp.put_u32_le(self.seq);
24973 __tmp.put_u8(self.target_system);
24974 __tmp.put_u8(self.target_component);
24975 if matches!(version, MavlinkVersion::V2) {
24976 let len = __tmp.len();
24977 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24978 } else {
24979 __tmp.len()
24980 }
24981 }
24982}
24983#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
24984#[doc = "Control vehicle tone generation (buzzer)."]
24985#[doc = ""]
24986#[doc = "ID: 258"]
24987#[derive(Debug, Clone, PartialEq)]
24988#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24989#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24990#[cfg_attr(feature = "ts", derive(TS))]
24991#[cfg_attr(feature = "ts", ts(export))]
24992pub struct PLAY_TUNE_DATA {
24993 #[doc = "System ID"]
24994 pub target_system: u8,
24995 #[doc = "Component ID"]
24996 pub target_component: u8,
24997 #[doc = "tune in board specific format"]
24998 #[cfg_attr(feature = "ts", ts(type = "string"))]
24999 pub tune: CharArray<30>,
25000 #[doc = "tune extension (appended to tune)"]
25001 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25002 #[cfg_attr(feature = "ts", ts(type = "string"))]
25003 pub tune2: CharArray<200>,
25004}
25005impl PLAY_TUNE_DATA {
25006 pub const ENCODED_LEN: usize = 232usize;
25007 pub const DEFAULT: Self = Self {
25008 target_system: 0_u8,
25009 target_component: 0_u8,
25010 tune: CharArray::new([0_u8; 30usize]),
25011 tune2: CharArray::new([0_u8; 200usize]),
25012 };
25013 #[cfg(feature = "arbitrary")]
25014 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25015 use arbitrary::{Arbitrary, Unstructured};
25016 let mut buf = [0u8; 1024];
25017 rng.fill_bytes(&mut buf);
25018 let mut unstructured = Unstructured::new(&buf);
25019 Self::arbitrary(&mut unstructured).unwrap_or_default()
25020 }
25021}
25022impl Default for PLAY_TUNE_DATA {
25023 fn default() -> Self {
25024 Self::DEFAULT.clone()
25025 }
25026}
25027impl MessageData for PLAY_TUNE_DATA {
25028 type Message = MavMessage;
25029 const ID: u32 = 258u32;
25030 const NAME: &'static str = "PLAY_TUNE";
25031 const EXTRA_CRC: u8 = 187u8;
25032 const ENCODED_LEN: usize = 232usize;
25033 fn deser(
25034 _version: MavlinkVersion,
25035 __input: &[u8],
25036 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25037 let avail_len = __input.len();
25038 let mut payload_buf = [0; Self::ENCODED_LEN];
25039 let mut buf = if avail_len < Self::ENCODED_LEN {
25040 payload_buf[0..avail_len].copy_from_slice(__input);
25041 Bytes::new(&payload_buf)
25042 } else {
25043 Bytes::new(__input)
25044 };
25045 let mut __struct = Self::default();
25046 __struct.target_system = buf.get_u8()?;
25047 __struct.target_component = buf.get_u8()?;
25048 let mut tmp = [0_u8; 30usize];
25049 for v in &mut tmp {
25050 *v = buf.get_u8()?;
25051 }
25052 __struct.tune = CharArray::new(tmp);
25053 let mut tmp = [0_u8; 200usize];
25054 for v in &mut tmp {
25055 *v = buf.get_u8()?;
25056 }
25057 __struct.tune2 = CharArray::new(tmp);
25058 Ok(__struct)
25059 }
25060 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25061 let mut __tmp = BytesMut::new(bytes);
25062 #[allow(clippy::absurd_extreme_comparisons)]
25063 #[allow(unused_comparisons)]
25064 if __tmp.remaining() < Self::ENCODED_LEN {
25065 panic!(
25066 "buffer is too small (need {} bytes, but got {})",
25067 Self::ENCODED_LEN,
25068 __tmp.remaining(),
25069 )
25070 }
25071 __tmp.put_u8(self.target_system);
25072 __tmp.put_u8(self.target_component);
25073 for val in &self.tune {
25074 __tmp.put_u8(*val);
25075 }
25076 if matches!(version, MavlinkVersion::V2) {
25077 for val in &self.tune2 {
25078 __tmp.put_u8(*val);
25079 }
25080 let len = __tmp.len();
25081 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25082 } else {
25083 __tmp.len()
25084 }
25085 }
25086}
25087#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
25088#[doc = ""]
25089#[doc = "ID: 400"]
25090#[derive(Debug, Clone, PartialEq)]
25091#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25092#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25093#[cfg_attr(feature = "ts", derive(TS))]
25094#[cfg_attr(feature = "ts", ts(export))]
25095pub struct PLAY_TUNE_V2_DATA {
25096 #[doc = "Tune format"]
25097 pub format: TuneFormat,
25098 #[doc = "System ID"]
25099 pub target_system: u8,
25100 #[doc = "Component ID"]
25101 pub target_component: u8,
25102 #[doc = "Tune definition as a NULL-terminated string."]
25103 #[cfg_attr(feature = "ts", ts(type = "string"))]
25104 pub tune: CharArray<248>,
25105}
25106impl PLAY_TUNE_V2_DATA {
25107 pub const ENCODED_LEN: usize = 254usize;
25108 pub const DEFAULT: Self = Self {
25109 format: TuneFormat::DEFAULT,
25110 target_system: 0_u8,
25111 target_component: 0_u8,
25112 tune: CharArray::new([0_u8; 248usize]),
25113 };
25114 #[cfg(feature = "arbitrary")]
25115 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25116 use arbitrary::{Arbitrary, Unstructured};
25117 let mut buf = [0u8; 1024];
25118 rng.fill_bytes(&mut buf);
25119 let mut unstructured = Unstructured::new(&buf);
25120 Self::arbitrary(&mut unstructured).unwrap_or_default()
25121 }
25122}
25123impl Default for PLAY_TUNE_V2_DATA {
25124 fn default() -> Self {
25125 Self::DEFAULT.clone()
25126 }
25127}
25128impl MessageData for PLAY_TUNE_V2_DATA {
25129 type Message = MavMessage;
25130 const ID: u32 = 400u32;
25131 const NAME: &'static str = "PLAY_TUNE_V2";
25132 const EXTRA_CRC: u8 = 110u8;
25133 const ENCODED_LEN: usize = 254usize;
25134 fn deser(
25135 _version: MavlinkVersion,
25136 __input: &[u8],
25137 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25138 let avail_len = __input.len();
25139 let mut payload_buf = [0; Self::ENCODED_LEN];
25140 let mut buf = if avail_len < Self::ENCODED_LEN {
25141 payload_buf[0..avail_len].copy_from_slice(__input);
25142 Bytes::new(&payload_buf)
25143 } else {
25144 Bytes::new(__input)
25145 };
25146 let mut __struct = Self::default();
25147 let tmp = buf.get_u32_le()?;
25148 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
25149 ::mavlink_core::error::ParserError::InvalidEnum {
25150 enum_type: "TuneFormat",
25151 value: tmp as u64,
25152 },
25153 )?;
25154 __struct.target_system = buf.get_u8()?;
25155 __struct.target_component = buf.get_u8()?;
25156 let mut tmp = [0_u8; 248usize];
25157 for v in &mut tmp {
25158 *v = buf.get_u8()?;
25159 }
25160 __struct.tune = CharArray::new(tmp);
25161 Ok(__struct)
25162 }
25163 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25164 let mut __tmp = BytesMut::new(bytes);
25165 #[allow(clippy::absurd_extreme_comparisons)]
25166 #[allow(unused_comparisons)]
25167 if __tmp.remaining() < Self::ENCODED_LEN {
25168 panic!(
25169 "buffer is too small (need {} bytes, but got {})",
25170 Self::ENCODED_LEN,
25171 __tmp.remaining(),
25172 )
25173 }
25174 __tmp.put_u32_le(self.format as u32);
25175 __tmp.put_u8(self.target_system);
25176 __tmp.put_u8(self.target_component);
25177 for val in &self.tune {
25178 __tmp.put_u8(*val);
25179 }
25180 if matches!(version, MavlinkVersion::V2) {
25181 let len = __tmp.len();
25182 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25183 } else {
25184 __tmp.len()
25185 }
25186 }
25187}
25188#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
25189#[doc = ""]
25190#[doc = "ID: 87"]
25191#[derive(Debug, Clone, PartialEq)]
25192#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25193#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25194#[cfg_attr(feature = "ts", derive(TS))]
25195#[cfg_attr(feature = "ts", ts(export))]
25196pub struct POSITION_TARGET_GLOBAL_INT_DATA {
25197 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
25198 pub time_boot_ms: u32,
25199 #[doc = "Latitude in WGS84 frame"]
25200 pub lat_int: i32,
25201 #[doc = "Longitude in WGS84 frame"]
25202 pub lon_int: i32,
25203 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
25204 pub alt: f32,
25205 #[doc = "X velocity in NED frame"]
25206 pub vx: f32,
25207 #[doc = "Y velocity in NED frame"]
25208 pub vy: f32,
25209 #[doc = "Z velocity in NED frame"]
25210 pub vz: f32,
25211 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25212 pub afx: f32,
25213 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25214 pub afy: f32,
25215 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25216 pub afz: f32,
25217 #[doc = "yaw setpoint"]
25218 pub yaw: f32,
25219 #[doc = "yaw rate setpoint"]
25220 pub yaw_rate: f32,
25221 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
25222 pub type_mask: PositionTargetTypemask,
25223 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
25224 pub coordinate_frame: MavFrame,
25225}
25226impl POSITION_TARGET_GLOBAL_INT_DATA {
25227 pub const ENCODED_LEN: usize = 51usize;
25228 pub const DEFAULT: Self = Self {
25229 time_boot_ms: 0_u32,
25230 lat_int: 0_i32,
25231 lon_int: 0_i32,
25232 alt: 0.0_f32,
25233 vx: 0.0_f32,
25234 vy: 0.0_f32,
25235 vz: 0.0_f32,
25236 afx: 0.0_f32,
25237 afy: 0.0_f32,
25238 afz: 0.0_f32,
25239 yaw: 0.0_f32,
25240 yaw_rate: 0.0_f32,
25241 type_mask: PositionTargetTypemask::DEFAULT,
25242 coordinate_frame: MavFrame::DEFAULT,
25243 };
25244 #[cfg(feature = "arbitrary")]
25245 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25246 use arbitrary::{Arbitrary, Unstructured};
25247 let mut buf = [0u8; 1024];
25248 rng.fill_bytes(&mut buf);
25249 let mut unstructured = Unstructured::new(&buf);
25250 Self::arbitrary(&mut unstructured).unwrap_or_default()
25251 }
25252}
25253impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
25254 fn default() -> Self {
25255 Self::DEFAULT.clone()
25256 }
25257}
25258impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
25259 type Message = MavMessage;
25260 const ID: u32 = 87u32;
25261 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
25262 const EXTRA_CRC: u8 = 150u8;
25263 const ENCODED_LEN: usize = 51usize;
25264 fn deser(
25265 _version: MavlinkVersion,
25266 __input: &[u8],
25267 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25268 let avail_len = __input.len();
25269 let mut payload_buf = [0; Self::ENCODED_LEN];
25270 let mut buf = if avail_len < Self::ENCODED_LEN {
25271 payload_buf[0..avail_len].copy_from_slice(__input);
25272 Bytes::new(&payload_buf)
25273 } else {
25274 Bytes::new(__input)
25275 };
25276 let mut __struct = Self::default();
25277 __struct.time_boot_ms = buf.get_u32_le()?;
25278 __struct.lat_int = buf.get_i32_le()?;
25279 __struct.lon_int = buf.get_i32_le()?;
25280 __struct.alt = buf.get_f32_le()?;
25281 __struct.vx = buf.get_f32_le()?;
25282 __struct.vy = buf.get_f32_le()?;
25283 __struct.vz = buf.get_f32_le()?;
25284 __struct.afx = buf.get_f32_le()?;
25285 __struct.afy = buf.get_f32_le()?;
25286 __struct.afz = buf.get_f32_le()?;
25287 __struct.yaw = buf.get_f32_le()?;
25288 __struct.yaw_rate = buf.get_f32_le()?;
25289 let tmp = buf.get_u16_le()?;
25290 __struct.type_mask =
25291 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
25292 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
25293 flag_type: "PositionTargetTypemask",
25294 value: tmp as u64,
25295 })?;
25296 let tmp = buf.get_u8()?;
25297 __struct.coordinate_frame =
25298 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25299 enum_type: "MavFrame",
25300 value: tmp as u64,
25301 })?;
25302 Ok(__struct)
25303 }
25304 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25305 let mut __tmp = BytesMut::new(bytes);
25306 #[allow(clippy::absurd_extreme_comparisons)]
25307 #[allow(unused_comparisons)]
25308 if __tmp.remaining() < Self::ENCODED_LEN {
25309 panic!(
25310 "buffer is too small (need {} bytes, but got {})",
25311 Self::ENCODED_LEN,
25312 __tmp.remaining(),
25313 )
25314 }
25315 __tmp.put_u32_le(self.time_boot_ms);
25316 __tmp.put_i32_le(self.lat_int);
25317 __tmp.put_i32_le(self.lon_int);
25318 __tmp.put_f32_le(self.alt);
25319 __tmp.put_f32_le(self.vx);
25320 __tmp.put_f32_le(self.vy);
25321 __tmp.put_f32_le(self.vz);
25322 __tmp.put_f32_le(self.afx);
25323 __tmp.put_f32_le(self.afy);
25324 __tmp.put_f32_le(self.afz);
25325 __tmp.put_f32_le(self.yaw);
25326 __tmp.put_f32_le(self.yaw_rate);
25327 __tmp.put_u16_le(self.type_mask.bits() as u16);
25328 __tmp.put_u8(self.coordinate_frame as u8);
25329 if matches!(version, MavlinkVersion::V2) {
25330 let len = __tmp.len();
25331 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25332 } else {
25333 __tmp.len()
25334 }
25335 }
25336}
25337#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
25338#[doc = ""]
25339#[doc = "ID: 85"]
25340#[derive(Debug, Clone, PartialEq)]
25341#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25342#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25343#[cfg_attr(feature = "ts", derive(TS))]
25344#[cfg_attr(feature = "ts", ts(export))]
25345pub struct POSITION_TARGET_LOCAL_NED_DATA {
25346 #[doc = "Timestamp (time since system boot)."]
25347 pub time_boot_ms: u32,
25348 #[doc = "X Position in NED frame"]
25349 pub x: f32,
25350 #[doc = "Y Position in NED frame"]
25351 pub y: f32,
25352 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
25353 pub z: f32,
25354 #[doc = "X velocity in NED frame"]
25355 pub vx: f32,
25356 #[doc = "Y velocity in NED frame"]
25357 pub vy: f32,
25358 #[doc = "Z velocity in NED frame"]
25359 pub vz: f32,
25360 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25361 pub afx: f32,
25362 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25363 pub afy: f32,
25364 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
25365 pub afz: f32,
25366 #[doc = "yaw setpoint"]
25367 pub yaw: f32,
25368 #[doc = "yaw rate setpoint"]
25369 pub yaw_rate: f32,
25370 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
25371 pub type_mask: PositionTargetTypemask,
25372 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
25373 pub coordinate_frame: MavFrame,
25374}
25375impl POSITION_TARGET_LOCAL_NED_DATA {
25376 pub const ENCODED_LEN: usize = 51usize;
25377 pub const DEFAULT: Self = Self {
25378 time_boot_ms: 0_u32,
25379 x: 0.0_f32,
25380 y: 0.0_f32,
25381 z: 0.0_f32,
25382 vx: 0.0_f32,
25383 vy: 0.0_f32,
25384 vz: 0.0_f32,
25385 afx: 0.0_f32,
25386 afy: 0.0_f32,
25387 afz: 0.0_f32,
25388 yaw: 0.0_f32,
25389 yaw_rate: 0.0_f32,
25390 type_mask: PositionTargetTypemask::DEFAULT,
25391 coordinate_frame: MavFrame::DEFAULT,
25392 };
25393 #[cfg(feature = "arbitrary")]
25394 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25395 use arbitrary::{Arbitrary, Unstructured};
25396 let mut buf = [0u8; 1024];
25397 rng.fill_bytes(&mut buf);
25398 let mut unstructured = Unstructured::new(&buf);
25399 Self::arbitrary(&mut unstructured).unwrap_or_default()
25400 }
25401}
25402impl Default for POSITION_TARGET_LOCAL_NED_DATA {
25403 fn default() -> Self {
25404 Self::DEFAULT.clone()
25405 }
25406}
25407impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
25408 type Message = MavMessage;
25409 const ID: u32 = 85u32;
25410 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
25411 const EXTRA_CRC: u8 = 140u8;
25412 const ENCODED_LEN: usize = 51usize;
25413 fn deser(
25414 _version: MavlinkVersion,
25415 __input: &[u8],
25416 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25417 let avail_len = __input.len();
25418 let mut payload_buf = [0; Self::ENCODED_LEN];
25419 let mut buf = if avail_len < Self::ENCODED_LEN {
25420 payload_buf[0..avail_len].copy_from_slice(__input);
25421 Bytes::new(&payload_buf)
25422 } else {
25423 Bytes::new(__input)
25424 };
25425 let mut __struct = Self::default();
25426 __struct.time_boot_ms = buf.get_u32_le()?;
25427 __struct.x = buf.get_f32_le()?;
25428 __struct.y = buf.get_f32_le()?;
25429 __struct.z = buf.get_f32_le()?;
25430 __struct.vx = buf.get_f32_le()?;
25431 __struct.vy = buf.get_f32_le()?;
25432 __struct.vz = buf.get_f32_le()?;
25433 __struct.afx = buf.get_f32_le()?;
25434 __struct.afy = buf.get_f32_le()?;
25435 __struct.afz = buf.get_f32_le()?;
25436 __struct.yaw = buf.get_f32_le()?;
25437 __struct.yaw_rate = buf.get_f32_le()?;
25438 let tmp = buf.get_u16_le()?;
25439 __struct.type_mask =
25440 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
25441 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
25442 flag_type: "PositionTargetTypemask",
25443 value: tmp as u64,
25444 })?;
25445 let tmp = buf.get_u8()?;
25446 __struct.coordinate_frame =
25447 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25448 enum_type: "MavFrame",
25449 value: tmp as u64,
25450 })?;
25451 Ok(__struct)
25452 }
25453 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25454 let mut __tmp = BytesMut::new(bytes);
25455 #[allow(clippy::absurd_extreme_comparisons)]
25456 #[allow(unused_comparisons)]
25457 if __tmp.remaining() < Self::ENCODED_LEN {
25458 panic!(
25459 "buffer is too small (need {} bytes, but got {})",
25460 Self::ENCODED_LEN,
25461 __tmp.remaining(),
25462 )
25463 }
25464 __tmp.put_u32_le(self.time_boot_ms);
25465 __tmp.put_f32_le(self.x);
25466 __tmp.put_f32_le(self.y);
25467 __tmp.put_f32_le(self.z);
25468 __tmp.put_f32_le(self.vx);
25469 __tmp.put_f32_le(self.vy);
25470 __tmp.put_f32_le(self.vz);
25471 __tmp.put_f32_le(self.afx);
25472 __tmp.put_f32_le(self.afy);
25473 __tmp.put_f32_le(self.afz);
25474 __tmp.put_f32_le(self.yaw);
25475 __tmp.put_f32_le(self.yaw_rate);
25476 __tmp.put_u16_le(self.type_mask.bits() as u16);
25477 __tmp.put_u8(self.coordinate_frame as u8);
25478 if matches!(version, MavlinkVersion::V2) {
25479 let len = __tmp.len();
25480 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25481 } else {
25482 __tmp.len()
25483 }
25484 }
25485}
25486#[doc = "Power supply status."]
25487#[doc = ""]
25488#[doc = "ID: 125"]
25489#[derive(Debug, Clone, PartialEq)]
25490#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25491#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25492#[cfg_attr(feature = "ts", derive(TS))]
25493#[cfg_attr(feature = "ts", ts(export))]
25494pub struct POWER_STATUS_DATA {
25495 #[doc = "5V rail voltage."]
25496 pub Vcc: u16,
25497 #[doc = "Servo rail voltage."]
25498 pub Vservo: u16,
25499 #[doc = "Bitmap of power supply status flags."]
25500 pub flags: MavPowerStatus,
25501}
25502impl POWER_STATUS_DATA {
25503 pub const ENCODED_LEN: usize = 6usize;
25504 pub const DEFAULT: Self = Self {
25505 Vcc: 0_u16,
25506 Vservo: 0_u16,
25507 flags: MavPowerStatus::DEFAULT,
25508 };
25509 #[cfg(feature = "arbitrary")]
25510 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25511 use arbitrary::{Arbitrary, Unstructured};
25512 let mut buf = [0u8; 1024];
25513 rng.fill_bytes(&mut buf);
25514 let mut unstructured = Unstructured::new(&buf);
25515 Self::arbitrary(&mut unstructured).unwrap_or_default()
25516 }
25517}
25518impl Default for POWER_STATUS_DATA {
25519 fn default() -> Self {
25520 Self::DEFAULT.clone()
25521 }
25522}
25523impl MessageData for POWER_STATUS_DATA {
25524 type Message = MavMessage;
25525 const ID: u32 = 125u32;
25526 const NAME: &'static str = "POWER_STATUS";
25527 const EXTRA_CRC: u8 = 203u8;
25528 const ENCODED_LEN: usize = 6usize;
25529 fn deser(
25530 _version: MavlinkVersion,
25531 __input: &[u8],
25532 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25533 let avail_len = __input.len();
25534 let mut payload_buf = [0; Self::ENCODED_LEN];
25535 let mut buf = if avail_len < Self::ENCODED_LEN {
25536 payload_buf[0..avail_len].copy_from_slice(__input);
25537 Bytes::new(&payload_buf)
25538 } else {
25539 Bytes::new(__input)
25540 };
25541 let mut __struct = Self::default();
25542 __struct.Vcc = buf.get_u16_le()?;
25543 __struct.Vservo = buf.get_u16_le()?;
25544 let tmp = buf.get_u16_le()?;
25545 __struct.flags = MavPowerStatus::from_bits(tmp as <MavPowerStatus as Flags>::Bits).ok_or(
25546 ::mavlink_core::error::ParserError::InvalidFlag {
25547 flag_type: "MavPowerStatus",
25548 value: tmp as u64,
25549 },
25550 )?;
25551 Ok(__struct)
25552 }
25553 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25554 let mut __tmp = BytesMut::new(bytes);
25555 #[allow(clippy::absurd_extreme_comparisons)]
25556 #[allow(unused_comparisons)]
25557 if __tmp.remaining() < Self::ENCODED_LEN {
25558 panic!(
25559 "buffer is too small (need {} bytes, but got {})",
25560 Self::ENCODED_LEN,
25561 __tmp.remaining(),
25562 )
25563 }
25564 __tmp.put_u16_le(self.Vcc);
25565 __tmp.put_u16_le(self.Vservo);
25566 __tmp.put_u16_le(self.flags.bits() as u16);
25567 if matches!(version, MavlinkVersion::V2) {
25568 let len = __tmp.len();
25569 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25570 } else {
25571 __tmp.len()
25572 }
25573 }
25574}
25575#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
25576#[doc = ""]
25577#[doc = "ID: 300"]
25578#[derive(Debug, Clone, PartialEq)]
25579#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25580#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25581#[cfg_attr(feature = "ts", derive(TS))]
25582#[cfg_attr(feature = "ts", ts(export))]
25583pub struct PROTOCOL_VERSION_DATA {
25584 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
25585 pub version: u16,
25586 #[doc = "Minimum MAVLink version supported"]
25587 pub min_version: u16,
25588 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
25589 pub max_version: u16,
25590 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
25591 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25592 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25593 pub spec_version_hash: [u8; 8],
25594 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
25595 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25596 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
25597 pub library_version_hash: [u8; 8],
25598}
25599impl PROTOCOL_VERSION_DATA {
25600 pub const ENCODED_LEN: usize = 22usize;
25601 pub const DEFAULT: Self = Self {
25602 version: 0_u16,
25603 min_version: 0_u16,
25604 max_version: 0_u16,
25605 spec_version_hash: [0_u8; 8usize],
25606 library_version_hash: [0_u8; 8usize],
25607 };
25608 #[cfg(feature = "arbitrary")]
25609 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25610 use arbitrary::{Arbitrary, Unstructured};
25611 let mut buf = [0u8; 1024];
25612 rng.fill_bytes(&mut buf);
25613 let mut unstructured = Unstructured::new(&buf);
25614 Self::arbitrary(&mut unstructured).unwrap_or_default()
25615 }
25616}
25617impl Default for PROTOCOL_VERSION_DATA {
25618 fn default() -> Self {
25619 Self::DEFAULT.clone()
25620 }
25621}
25622impl MessageData for PROTOCOL_VERSION_DATA {
25623 type Message = MavMessage;
25624 const ID: u32 = 300u32;
25625 const NAME: &'static str = "PROTOCOL_VERSION";
25626 const EXTRA_CRC: u8 = 217u8;
25627 const ENCODED_LEN: usize = 22usize;
25628 fn deser(
25629 _version: MavlinkVersion,
25630 __input: &[u8],
25631 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25632 let avail_len = __input.len();
25633 let mut payload_buf = [0; Self::ENCODED_LEN];
25634 let mut buf = if avail_len < Self::ENCODED_LEN {
25635 payload_buf[0..avail_len].copy_from_slice(__input);
25636 Bytes::new(&payload_buf)
25637 } else {
25638 Bytes::new(__input)
25639 };
25640 let mut __struct = Self::default();
25641 __struct.version = buf.get_u16_le()?;
25642 __struct.min_version = buf.get_u16_le()?;
25643 __struct.max_version = buf.get_u16_le()?;
25644 for v in &mut __struct.spec_version_hash {
25645 let val = buf.get_u8()?;
25646 *v = val;
25647 }
25648 for v in &mut __struct.library_version_hash {
25649 let val = buf.get_u8()?;
25650 *v = val;
25651 }
25652 Ok(__struct)
25653 }
25654 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25655 let mut __tmp = BytesMut::new(bytes);
25656 #[allow(clippy::absurd_extreme_comparisons)]
25657 #[allow(unused_comparisons)]
25658 if __tmp.remaining() < Self::ENCODED_LEN {
25659 panic!(
25660 "buffer is too small (need {} bytes, but got {})",
25661 Self::ENCODED_LEN,
25662 __tmp.remaining(),
25663 )
25664 }
25665 __tmp.put_u16_le(self.version);
25666 __tmp.put_u16_le(self.min_version);
25667 __tmp.put_u16_le(self.max_version);
25668 for val in &self.spec_version_hash {
25669 __tmp.put_u8(*val);
25670 }
25671 for val in &self.library_version_hash {
25672 __tmp.put_u8(*val);
25673 }
25674 if matches!(version, MavlinkVersion::V2) {
25675 let len = __tmp.len();
25676 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25677 } else {
25678 __tmp.len()
25679 }
25680 }
25681}
25682#[doc = "Status generated by radio and injected into MAVLink stream."]
25683#[doc = ""]
25684#[doc = "ID: 109"]
25685#[derive(Debug, Clone, PartialEq)]
25686#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25687#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25688#[cfg_attr(feature = "ts", derive(TS))]
25689#[cfg_attr(feature = "ts", ts(export))]
25690pub struct RADIO_STATUS_DATA {
25691 #[doc = "Count of radio packet receive errors (since boot)."]
25692 pub rxerrors: u16,
25693 #[doc = "Count of error corrected radio packets (since boot)."]
25694 pub fixed: u16,
25695 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25696 pub rssi: u8,
25697 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25698 pub remrssi: u8,
25699 #[doc = "Remaining free transmitter buffer space."]
25700 pub txbuf: u8,
25701 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25702 pub noise: u8,
25703 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
25704 pub remnoise: u8,
25705}
25706impl RADIO_STATUS_DATA {
25707 pub const ENCODED_LEN: usize = 9usize;
25708 pub const DEFAULT: Self = Self {
25709 rxerrors: 0_u16,
25710 fixed: 0_u16,
25711 rssi: 0_u8,
25712 remrssi: 0_u8,
25713 txbuf: 0_u8,
25714 noise: 0_u8,
25715 remnoise: 0_u8,
25716 };
25717 #[cfg(feature = "arbitrary")]
25718 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25719 use arbitrary::{Arbitrary, Unstructured};
25720 let mut buf = [0u8; 1024];
25721 rng.fill_bytes(&mut buf);
25722 let mut unstructured = Unstructured::new(&buf);
25723 Self::arbitrary(&mut unstructured).unwrap_or_default()
25724 }
25725}
25726impl Default for RADIO_STATUS_DATA {
25727 fn default() -> Self {
25728 Self::DEFAULT.clone()
25729 }
25730}
25731impl MessageData for RADIO_STATUS_DATA {
25732 type Message = MavMessage;
25733 const ID: u32 = 109u32;
25734 const NAME: &'static str = "RADIO_STATUS";
25735 const EXTRA_CRC: u8 = 185u8;
25736 const ENCODED_LEN: usize = 9usize;
25737 fn deser(
25738 _version: MavlinkVersion,
25739 __input: &[u8],
25740 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25741 let avail_len = __input.len();
25742 let mut payload_buf = [0; Self::ENCODED_LEN];
25743 let mut buf = if avail_len < Self::ENCODED_LEN {
25744 payload_buf[0..avail_len].copy_from_slice(__input);
25745 Bytes::new(&payload_buf)
25746 } else {
25747 Bytes::new(__input)
25748 };
25749 let mut __struct = Self::default();
25750 __struct.rxerrors = buf.get_u16_le()?;
25751 __struct.fixed = buf.get_u16_le()?;
25752 __struct.rssi = buf.get_u8()?;
25753 __struct.remrssi = buf.get_u8()?;
25754 __struct.txbuf = buf.get_u8()?;
25755 __struct.noise = buf.get_u8()?;
25756 __struct.remnoise = buf.get_u8()?;
25757 Ok(__struct)
25758 }
25759 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25760 let mut __tmp = BytesMut::new(bytes);
25761 #[allow(clippy::absurd_extreme_comparisons)]
25762 #[allow(unused_comparisons)]
25763 if __tmp.remaining() < Self::ENCODED_LEN {
25764 panic!(
25765 "buffer is too small (need {} bytes, but got {})",
25766 Self::ENCODED_LEN,
25767 __tmp.remaining(),
25768 )
25769 }
25770 __tmp.put_u16_le(self.rxerrors);
25771 __tmp.put_u16_le(self.fixed);
25772 __tmp.put_u8(self.rssi);
25773 __tmp.put_u8(self.remrssi);
25774 __tmp.put_u8(self.txbuf);
25775 __tmp.put_u8(self.noise);
25776 __tmp.put_u8(self.remnoise);
25777 if matches!(version, MavlinkVersion::V2) {
25778 let len = __tmp.len();
25779 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25780 } else {
25781 __tmp.len()
25782 }
25783 }
25784}
25785#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
25786#[doc = ""]
25787#[doc = "ID: 27"]
25788#[derive(Debug, Clone, PartialEq)]
25789#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25790#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25791#[cfg_attr(feature = "ts", derive(TS))]
25792#[cfg_attr(feature = "ts", ts(export))]
25793pub struct RAW_IMU_DATA {
25794 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25795 pub time_usec: u64,
25796 #[doc = "X acceleration (raw)"]
25797 pub xacc: i16,
25798 #[doc = "Y acceleration (raw)"]
25799 pub yacc: i16,
25800 #[doc = "Z acceleration (raw)"]
25801 pub zacc: i16,
25802 #[doc = "Angular speed around X axis (raw)"]
25803 pub xgyro: i16,
25804 #[doc = "Angular speed around Y axis (raw)"]
25805 pub ygyro: i16,
25806 #[doc = "Angular speed around Z axis (raw)"]
25807 pub zgyro: i16,
25808 #[doc = "X Magnetic field (raw)"]
25809 pub xmag: i16,
25810 #[doc = "Y Magnetic field (raw)"]
25811 pub ymag: i16,
25812 #[doc = "Z Magnetic field (raw)"]
25813 pub zmag: i16,
25814 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
25815 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25816 pub id: u8,
25817 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
25818 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25819 pub temperature: i16,
25820}
25821impl RAW_IMU_DATA {
25822 pub const ENCODED_LEN: usize = 29usize;
25823 pub const DEFAULT: Self = Self {
25824 time_usec: 0_u64,
25825 xacc: 0_i16,
25826 yacc: 0_i16,
25827 zacc: 0_i16,
25828 xgyro: 0_i16,
25829 ygyro: 0_i16,
25830 zgyro: 0_i16,
25831 xmag: 0_i16,
25832 ymag: 0_i16,
25833 zmag: 0_i16,
25834 id: 0_u8,
25835 temperature: 0_i16,
25836 };
25837 #[cfg(feature = "arbitrary")]
25838 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25839 use arbitrary::{Arbitrary, Unstructured};
25840 let mut buf = [0u8; 1024];
25841 rng.fill_bytes(&mut buf);
25842 let mut unstructured = Unstructured::new(&buf);
25843 Self::arbitrary(&mut unstructured).unwrap_or_default()
25844 }
25845}
25846impl Default for RAW_IMU_DATA {
25847 fn default() -> Self {
25848 Self::DEFAULT.clone()
25849 }
25850}
25851impl MessageData for RAW_IMU_DATA {
25852 type Message = MavMessage;
25853 const ID: u32 = 27u32;
25854 const NAME: &'static str = "RAW_IMU";
25855 const EXTRA_CRC: u8 = 144u8;
25856 const ENCODED_LEN: usize = 29usize;
25857 fn deser(
25858 _version: MavlinkVersion,
25859 __input: &[u8],
25860 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25861 let avail_len = __input.len();
25862 let mut payload_buf = [0; Self::ENCODED_LEN];
25863 let mut buf = if avail_len < Self::ENCODED_LEN {
25864 payload_buf[0..avail_len].copy_from_slice(__input);
25865 Bytes::new(&payload_buf)
25866 } else {
25867 Bytes::new(__input)
25868 };
25869 let mut __struct = Self::default();
25870 __struct.time_usec = buf.get_u64_le()?;
25871 __struct.xacc = buf.get_i16_le()?;
25872 __struct.yacc = buf.get_i16_le()?;
25873 __struct.zacc = buf.get_i16_le()?;
25874 __struct.xgyro = buf.get_i16_le()?;
25875 __struct.ygyro = buf.get_i16_le()?;
25876 __struct.zgyro = buf.get_i16_le()?;
25877 __struct.xmag = buf.get_i16_le()?;
25878 __struct.ymag = buf.get_i16_le()?;
25879 __struct.zmag = buf.get_i16_le()?;
25880 __struct.id = buf.get_u8()?;
25881 __struct.temperature = buf.get_i16_le()?;
25882 Ok(__struct)
25883 }
25884 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25885 let mut __tmp = BytesMut::new(bytes);
25886 #[allow(clippy::absurd_extreme_comparisons)]
25887 #[allow(unused_comparisons)]
25888 if __tmp.remaining() < Self::ENCODED_LEN {
25889 panic!(
25890 "buffer is too small (need {} bytes, but got {})",
25891 Self::ENCODED_LEN,
25892 __tmp.remaining(),
25893 )
25894 }
25895 __tmp.put_u64_le(self.time_usec);
25896 __tmp.put_i16_le(self.xacc);
25897 __tmp.put_i16_le(self.yacc);
25898 __tmp.put_i16_le(self.zacc);
25899 __tmp.put_i16_le(self.xgyro);
25900 __tmp.put_i16_le(self.ygyro);
25901 __tmp.put_i16_le(self.zgyro);
25902 __tmp.put_i16_le(self.xmag);
25903 __tmp.put_i16_le(self.ymag);
25904 __tmp.put_i16_le(self.zmag);
25905 if matches!(version, MavlinkVersion::V2) {
25906 __tmp.put_u8(self.id);
25907 __tmp.put_i16_le(self.temperature);
25908 let len = __tmp.len();
25909 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25910 } else {
25911 __tmp.len()
25912 }
25913 }
25914}
25915#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
25916#[doc = ""]
25917#[doc = "ID: 28"]
25918#[derive(Debug, Clone, PartialEq)]
25919#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25920#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25921#[cfg_attr(feature = "ts", derive(TS))]
25922#[cfg_attr(feature = "ts", ts(export))]
25923pub struct RAW_PRESSURE_DATA {
25924 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
25925 pub time_usec: u64,
25926 #[doc = "Absolute pressure (raw)"]
25927 pub press_abs: i16,
25928 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
25929 pub press_diff1: i16,
25930 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
25931 pub press_diff2: i16,
25932 #[doc = "Raw Temperature measurement (raw)"]
25933 pub temperature: i16,
25934}
25935impl RAW_PRESSURE_DATA {
25936 pub const ENCODED_LEN: usize = 16usize;
25937 pub const DEFAULT: Self = Self {
25938 time_usec: 0_u64,
25939 press_abs: 0_i16,
25940 press_diff1: 0_i16,
25941 press_diff2: 0_i16,
25942 temperature: 0_i16,
25943 };
25944 #[cfg(feature = "arbitrary")]
25945 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25946 use arbitrary::{Arbitrary, Unstructured};
25947 let mut buf = [0u8; 1024];
25948 rng.fill_bytes(&mut buf);
25949 let mut unstructured = Unstructured::new(&buf);
25950 Self::arbitrary(&mut unstructured).unwrap_or_default()
25951 }
25952}
25953impl Default for RAW_PRESSURE_DATA {
25954 fn default() -> Self {
25955 Self::DEFAULT.clone()
25956 }
25957}
25958impl MessageData for RAW_PRESSURE_DATA {
25959 type Message = MavMessage;
25960 const ID: u32 = 28u32;
25961 const NAME: &'static str = "RAW_PRESSURE";
25962 const EXTRA_CRC: u8 = 67u8;
25963 const ENCODED_LEN: usize = 16usize;
25964 fn deser(
25965 _version: MavlinkVersion,
25966 __input: &[u8],
25967 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25968 let avail_len = __input.len();
25969 let mut payload_buf = [0; Self::ENCODED_LEN];
25970 let mut buf = if avail_len < Self::ENCODED_LEN {
25971 payload_buf[0..avail_len].copy_from_slice(__input);
25972 Bytes::new(&payload_buf)
25973 } else {
25974 Bytes::new(__input)
25975 };
25976 let mut __struct = Self::default();
25977 __struct.time_usec = buf.get_u64_le()?;
25978 __struct.press_abs = buf.get_i16_le()?;
25979 __struct.press_diff1 = buf.get_i16_le()?;
25980 __struct.press_diff2 = buf.get_i16_le()?;
25981 __struct.temperature = buf.get_i16_le()?;
25982 Ok(__struct)
25983 }
25984 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25985 let mut __tmp = BytesMut::new(bytes);
25986 #[allow(clippy::absurd_extreme_comparisons)]
25987 #[allow(unused_comparisons)]
25988 if __tmp.remaining() < Self::ENCODED_LEN {
25989 panic!(
25990 "buffer is too small (need {} bytes, but got {})",
25991 Self::ENCODED_LEN,
25992 __tmp.remaining(),
25993 )
25994 }
25995 __tmp.put_u64_le(self.time_usec);
25996 __tmp.put_i16_le(self.press_abs);
25997 __tmp.put_i16_le(self.press_diff1);
25998 __tmp.put_i16_le(self.press_diff2);
25999 __tmp.put_i16_le(self.temperature);
26000 if matches!(version, MavlinkVersion::V2) {
26001 let len = __tmp.len();
26002 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26003 } else {
26004 __tmp.len()
26005 }
26006 }
26007}
26008#[doc = "RPM sensor data message."]
26009#[doc = ""]
26010#[doc = "ID: 339"]
26011#[derive(Debug, Clone, PartialEq)]
26012#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26013#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26014#[cfg_attr(feature = "ts", derive(TS))]
26015#[cfg_attr(feature = "ts", ts(export))]
26016pub struct RAW_RPM_DATA {
26017 #[doc = "Indicated rate"]
26018 pub frequency: f32,
26019 #[doc = "Index of this RPM sensor (0-indexed)"]
26020 pub index: u8,
26021}
26022impl RAW_RPM_DATA {
26023 pub const ENCODED_LEN: usize = 5usize;
26024 pub const DEFAULT: Self = Self {
26025 frequency: 0.0_f32,
26026 index: 0_u8,
26027 };
26028 #[cfg(feature = "arbitrary")]
26029 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26030 use arbitrary::{Arbitrary, Unstructured};
26031 let mut buf = [0u8; 1024];
26032 rng.fill_bytes(&mut buf);
26033 let mut unstructured = Unstructured::new(&buf);
26034 Self::arbitrary(&mut unstructured).unwrap_or_default()
26035 }
26036}
26037impl Default for RAW_RPM_DATA {
26038 fn default() -> Self {
26039 Self::DEFAULT.clone()
26040 }
26041}
26042impl MessageData for RAW_RPM_DATA {
26043 type Message = MavMessage;
26044 const ID: u32 = 339u32;
26045 const NAME: &'static str = "RAW_RPM";
26046 const EXTRA_CRC: u8 = 199u8;
26047 const ENCODED_LEN: usize = 5usize;
26048 fn deser(
26049 _version: MavlinkVersion,
26050 __input: &[u8],
26051 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26052 let avail_len = __input.len();
26053 let mut payload_buf = [0; Self::ENCODED_LEN];
26054 let mut buf = if avail_len < Self::ENCODED_LEN {
26055 payload_buf[0..avail_len].copy_from_slice(__input);
26056 Bytes::new(&payload_buf)
26057 } else {
26058 Bytes::new(__input)
26059 };
26060 let mut __struct = Self::default();
26061 __struct.frequency = buf.get_f32_le()?;
26062 __struct.index = buf.get_u8()?;
26063 Ok(__struct)
26064 }
26065 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26066 let mut __tmp = BytesMut::new(bytes);
26067 #[allow(clippy::absurd_extreme_comparisons)]
26068 #[allow(unused_comparisons)]
26069 if __tmp.remaining() < Self::ENCODED_LEN {
26070 panic!(
26071 "buffer is too small (need {} bytes, but got {})",
26072 Self::ENCODED_LEN,
26073 __tmp.remaining(),
26074 )
26075 }
26076 __tmp.put_f32_le(self.frequency);
26077 __tmp.put_u8(self.index);
26078 if matches!(version, MavlinkVersion::V2) {
26079 let len = __tmp.len();
26080 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26081 } else {
26082 __tmp.len()
26083 }
26084 }
26085}
26086#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
26087#[doc = ""]
26088#[doc = "ID: 65"]
26089#[derive(Debug, Clone, PartialEq)]
26090#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26091#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26092#[cfg_attr(feature = "ts", derive(TS))]
26093#[cfg_attr(feature = "ts", ts(export))]
26094pub struct RC_CHANNELS_DATA {
26095 #[doc = "Timestamp (time since system boot)."]
26096 pub time_boot_ms: u32,
26097 #[doc = "RC channel 1 value."]
26098 pub chan1_raw: u16,
26099 #[doc = "RC channel 2 value."]
26100 pub chan2_raw: u16,
26101 #[doc = "RC channel 3 value."]
26102 pub chan3_raw: u16,
26103 #[doc = "RC channel 4 value."]
26104 pub chan4_raw: u16,
26105 #[doc = "RC channel 5 value."]
26106 pub chan5_raw: u16,
26107 #[doc = "RC channel 6 value."]
26108 pub chan6_raw: u16,
26109 #[doc = "RC channel 7 value."]
26110 pub chan7_raw: u16,
26111 #[doc = "RC channel 8 value."]
26112 pub chan8_raw: u16,
26113 #[doc = "RC channel 9 value."]
26114 pub chan9_raw: u16,
26115 #[doc = "RC channel 10 value."]
26116 pub chan10_raw: u16,
26117 #[doc = "RC channel 11 value."]
26118 pub chan11_raw: u16,
26119 #[doc = "RC channel 12 value."]
26120 pub chan12_raw: u16,
26121 #[doc = "RC channel 13 value."]
26122 pub chan13_raw: u16,
26123 #[doc = "RC channel 14 value."]
26124 pub chan14_raw: u16,
26125 #[doc = "RC channel 15 value."]
26126 pub chan15_raw: u16,
26127 #[doc = "RC channel 16 value."]
26128 pub chan16_raw: u16,
26129 #[doc = "RC channel 17 value."]
26130 pub chan17_raw: u16,
26131 #[doc = "RC channel 18 value."]
26132 pub chan18_raw: u16,
26133 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
26134 pub chancount: u8,
26135 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26136 pub rssi: u8,
26137}
26138impl RC_CHANNELS_DATA {
26139 pub const ENCODED_LEN: usize = 42usize;
26140 pub const DEFAULT: Self = Self {
26141 time_boot_ms: 0_u32,
26142 chan1_raw: 0_u16,
26143 chan2_raw: 0_u16,
26144 chan3_raw: 0_u16,
26145 chan4_raw: 0_u16,
26146 chan5_raw: 0_u16,
26147 chan6_raw: 0_u16,
26148 chan7_raw: 0_u16,
26149 chan8_raw: 0_u16,
26150 chan9_raw: 0_u16,
26151 chan10_raw: 0_u16,
26152 chan11_raw: 0_u16,
26153 chan12_raw: 0_u16,
26154 chan13_raw: 0_u16,
26155 chan14_raw: 0_u16,
26156 chan15_raw: 0_u16,
26157 chan16_raw: 0_u16,
26158 chan17_raw: 0_u16,
26159 chan18_raw: 0_u16,
26160 chancount: 0_u8,
26161 rssi: 0_u8,
26162 };
26163 #[cfg(feature = "arbitrary")]
26164 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26165 use arbitrary::{Arbitrary, Unstructured};
26166 let mut buf = [0u8; 1024];
26167 rng.fill_bytes(&mut buf);
26168 let mut unstructured = Unstructured::new(&buf);
26169 Self::arbitrary(&mut unstructured).unwrap_or_default()
26170 }
26171}
26172impl Default for RC_CHANNELS_DATA {
26173 fn default() -> Self {
26174 Self::DEFAULT.clone()
26175 }
26176}
26177impl MessageData for RC_CHANNELS_DATA {
26178 type Message = MavMessage;
26179 const ID: u32 = 65u32;
26180 const NAME: &'static str = "RC_CHANNELS";
26181 const EXTRA_CRC: u8 = 118u8;
26182 const ENCODED_LEN: usize = 42usize;
26183 fn deser(
26184 _version: MavlinkVersion,
26185 __input: &[u8],
26186 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26187 let avail_len = __input.len();
26188 let mut payload_buf = [0; Self::ENCODED_LEN];
26189 let mut buf = if avail_len < Self::ENCODED_LEN {
26190 payload_buf[0..avail_len].copy_from_slice(__input);
26191 Bytes::new(&payload_buf)
26192 } else {
26193 Bytes::new(__input)
26194 };
26195 let mut __struct = Self::default();
26196 __struct.time_boot_ms = buf.get_u32_le()?;
26197 __struct.chan1_raw = buf.get_u16_le()?;
26198 __struct.chan2_raw = buf.get_u16_le()?;
26199 __struct.chan3_raw = buf.get_u16_le()?;
26200 __struct.chan4_raw = buf.get_u16_le()?;
26201 __struct.chan5_raw = buf.get_u16_le()?;
26202 __struct.chan6_raw = buf.get_u16_le()?;
26203 __struct.chan7_raw = buf.get_u16_le()?;
26204 __struct.chan8_raw = buf.get_u16_le()?;
26205 __struct.chan9_raw = buf.get_u16_le()?;
26206 __struct.chan10_raw = buf.get_u16_le()?;
26207 __struct.chan11_raw = buf.get_u16_le()?;
26208 __struct.chan12_raw = buf.get_u16_le()?;
26209 __struct.chan13_raw = buf.get_u16_le()?;
26210 __struct.chan14_raw = buf.get_u16_le()?;
26211 __struct.chan15_raw = buf.get_u16_le()?;
26212 __struct.chan16_raw = buf.get_u16_le()?;
26213 __struct.chan17_raw = buf.get_u16_le()?;
26214 __struct.chan18_raw = buf.get_u16_le()?;
26215 __struct.chancount = buf.get_u8()?;
26216 __struct.rssi = buf.get_u8()?;
26217 Ok(__struct)
26218 }
26219 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26220 let mut __tmp = BytesMut::new(bytes);
26221 #[allow(clippy::absurd_extreme_comparisons)]
26222 #[allow(unused_comparisons)]
26223 if __tmp.remaining() < Self::ENCODED_LEN {
26224 panic!(
26225 "buffer is too small (need {} bytes, but got {})",
26226 Self::ENCODED_LEN,
26227 __tmp.remaining(),
26228 )
26229 }
26230 __tmp.put_u32_le(self.time_boot_ms);
26231 __tmp.put_u16_le(self.chan1_raw);
26232 __tmp.put_u16_le(self.chan2_raw);
26233 __tmp.put_u16_le(self.chan3_raw);
26234 __tmp.put_u16_le(self.chan4_raw);
26235 __tmp.put_u16_le(self.chan5_raw);
26236 __tmp.put_u16_le(self.chan6_raw);
26237 __tmp.put_u16_le(self.chan7_raw);
26238 __tmp.put_u16_le(self.chan8_raw);
26239 __tmp.put_u16_le(self.chan9_raw);
26240 __tmp.put_u16_le(self.chan10_raw);
26241 __tmp.put_u16_le(self.chan11_raw);
26242 __tmp.put_u16_le(self.chan12_raw);
26243 __tmp.put_u16_le(self.chan13_raw);
26244 __tmp.put_u16_le(self.chan14_raw);
26245 __tmp.put_u16_le(self.chan15_raw);
26246 __tmp.put_u16_le(self.chan16_raw);
26247 __tmp.put_u16_le(self.chan17_raw);
26248 __tmp.put_u16_le(self.chan18_raw);
26249 __tmp.put_u8(self.chancount);
26250 __tmp.put_u8(self.rssi);
26251 if matches!(version, MavlinkVersion::V2) {
26252 let len = __tmp.len();
26253 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26254 } else {
26255 __tmp.len()
26256 }
26257 }
26258}
26259#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
26260#[doc = ""]
26261#[doc = "ID: 70"]
26262#[derive(Debug, Clone, PartialEq)]
26263#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26264#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26265#[cfg_attr(feature = "ts", derive(TS))]
26266#[cfg_attr(feature = "ts", ts(export))]
26267pub struct RC_CHANNELS_OVERRIDE_DATA {
26268 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26269 pub chan1_raw: u16,
26270 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26271 pub chan2_raw: u16,
26272 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26273 pub chan3_raw: u16,
26274 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26275 pub chan4_raw: u16,
26276 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26277 pub chan5_raw: u16,
26278 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26279 pub chan6_raw: u16,
26280 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26281 pub chan7_raw: u16,
26282 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
26283 pub chan8_raw: u16,
26284 #[doc = "System ID"]
26285 pub target_system: u8,
26286 #[doc = "Component ID"]
26287 pub target_component: u8,
26288 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26289 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26290 pub chan9_raw: u16,
26291 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26292 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26293 pub chan10_raw: u16,
26294 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26295 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26296 pub chan11_raw: u16,
26297 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26298 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26299 pub chan12_raw: u16,
26300 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26301 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26302 pub chan13_raw: u16,
26303 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26304 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26305 pub chan14_raw: u16,
26306 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26307 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26308 pub chan15_raw: u16,
26309 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26310 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26311 pub chan16_raw: u16,
26312 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26313 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26314 pub chan17_raw: u16,
26315 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
26316 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26317 pub chan18_raw: u16,
26318}
26319impl RC_CHANNELS_OVERRIDE_DATA {
26320 pub const ENCODED_LEN: usize = 38usize;
26321 pub const DEFAULT: Self = Self {
26322 chan1_raw: 0_u16,
26323 chan2_raw: 0_u16,
26324 chan3_raw: 0_u16,
26325 chan4_raw: 0_u16,
26326 chan5_raw: 0_u16,
26327 chan6_raw: 0_u16,
26328 chan7_raw: 0_u16,
26329 chan8_raw: 0_u16,
26330 target_system: 0_u8,
26331 target_component: 0_u8,
26332 chan9_raw: 0_u16,
26333 chan10_raw: 0_u16,
26334 chan11_raw: 0_u16,
26335 chan12_raw: 0_u16,
26336 chan13_raw: 0_u16,
26337 chan14_raw: 0_u16,
26338 chan15_raw: 0_u16,
26339 chan16_raw: 0_u16,
26340 chan17_raw: 0_u16,
26341 chan18_raw: 0_u16,
26342 };
26343 #[cfg(feature = "arbitrary")]
26344 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26345 use arbitrary::{Arbitrary, Unstructured};
26346 let mut buf = [0u8; 1024];
26347 rng.fill_bytes(&mut buf);
26348 let mut unstructured = Unstructured::new(&buf);
26349 Self::arbitrary(&mut unstructured).unwrap_or_default()
26350 }
26351}
26352impl Default for RC_CHANNELS_OVERRIDE_DATA {
26353 fn default() -> Self {
26354 Self::DEFAULT.clone()
26355 }
26356}
26357impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
26358 type Message = MavMessage;
26359 const ID: u32 = 70u32;
26360 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
26361 const EXTRA_CRC: u8 = 124u8;
26362 const ENCODED_LEN: usize = 38usize;
26363 fn deser(
26364 _version: MavlinkVersion,
26365 __input: &[u8],
26366 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26367 let avail_len = __input.len();
26368 let mut payload_buf = [0; Self::ENCODED_LEN];
26369 let mut buf = if avail_len < Self::ENCODED_LEN {
26370 payload_buf[0..avail_len].copy_from_slice(__input);
26371 Bytes::new(&payload_buf)
26372 } else {
26373 Bytes::new(__input)
26374 };
26375 let mut __struct = Self::default();
26376 __struct.chan1_raw = buf.get_u16_le()?;
26377 __struct.chan2_raw = buf.get_u16_le()?;
26378 __struct.chan3_raw = buf.get_u16_le()?;
26379 __struct.chan4_raw = buf.get_u16_le()?;
26380 __struct.chan5_raw = buf.get_u16_le()?;
26381 __struct.chan6_raw = buf.get_u16_le()?;
26382 __struct.chan7_raw = buf.get_u16_le()?;
26383 __struct.chan8_raw = buf.get_u16_le()?;
26384 __struct.target_system = buf.get_u8()?;
26385 __struct.target_component = buf.get_u8()?;
26386 __struct.chan9_raw = buf.get_u16_le()?;
26387 __struct.chan10_raw = buf.get_u16_le()?;
26388 __struct.chan11_raw = buf.get_u16_le()?;
26389 __struct.chan12_raw = buf.get_u16_le()?;
26390 __struct.chan13_raw = buf.get_u16_le()?;
26391 __struct.chan14_raw = buf.get_u16_le()?;
26392 __struct.chan15_raw = buf.get_u16_le()?;
26393 __struct.chan16_raw = buf.get_u16_le()?;
26394 __struct.chan17_raw = buf.get_u16_le()?;
26395 __struct.chan18_raw = buf.get_u16_le()?;
26396 Ok(__struct)
26397 }
26398 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26399 let mut __tmp = BytesMut::new(bytes);
26400 #[allow(clippy::absurd_extreme_comparisons)]
26401 #[allow(unused_comparisons)]
26402 if __tmp.remaining() < Self::ENCODED_LEN {
26403 panic!(
26404 "buffer is too small (need {} bytes, but got {})",
26405 Self::ENCODED_LEN,
26406 __tmp.remaining(),
26407 )
26408 }
26409 __tmp.put_u16_le(self.chan1_raw);
26410 __tmp.put_u16_le(self.chan2_raw);
26411 __tmp.put_u16_le(self.chan3_raw);
26412 __tmp.put_u16_le(self.chan4_raw);
26413 __tmp.put_u16_le(self.chan5_raw);
26414 __tmp.put_u16_le(self.chan6_raw);
26415 __tmp.put_u16_le(self.chan7_raw);
26416 __tmp.put_u16_le(self.chan8_raw);
26417 __tmp.put_u8(self.target_system);
26418 __tmp.put_u8(self.target_component);
26419 if matches!(version, MavlinkVersion::V2) {
26420 __tmp.put_u16_le(self.chan9_raw);
26421 __tmp.put_u16_le(self.chan10_raw);
26422 __tmp.put_u16_le(self.chan11_raw);
26423 __tmp.put_u16_le(self.chan12_raw);
26424 __tmp.put_u16_le(self.chan13_raw);
26425 __tmp.put_u16_le(self.chan14_raw);
26426 __tmp.put_u16_le(self.chan15_raw);
26427 __tmp.put_u16_le(self.chan16_raw);
26428 __tmp.put_u16_le(self.chan17_raw);
26429 __tmp.put_u16_le(self.chan18_raw);
26430 let len = __tmp.len();
26431 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26432 } else {
26433 __tmp.len()
26434 }
26435 }
26436}
26437#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
26438#[doc = ""]
26439#[doc = "ID: 35"]
26440#[derive(Debug, Clone, PartialEq)]
26441#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26442#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26443#[cfg_attr(feature = "ts", derive(TS))]
26444#[cfg_attr(feature = "ts", ts(export))]
26445pub struct RC_CHANNELS_RAW_DATA {
26446 #[doc = "Timestamp (time since system boot)."]
26447 pub time_boot_ms: u32,
26448 #[doc = "RC channel 1 value."]
26449 pub chan1_raw: u16,
26450 #[doc = "RC channel 2 value."]
26451 pub chan2_raw: u16,
26452 #[doc = "RC channel 3 value."]
26453 pub chan3_raw: u16,
26454 #[doc = "RC channel 4 value."]
26455 pub chan4_raw: u16,
26456 #[doc = "RC channel 5 value."]
26457 pub chan5_raw: u16,
26458 #[doc = "RC channel 6 value."]
26459 pub chan6_raw: u16,
26460 #[doc = "RC channel 7 value."]
26461 pub chan7_raw: u16,
26462 #[doc = "RC channel 8 value."]
26463 pub chan8_raw: u16,
26464 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26465 pub port: u8,
26466 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26467 pub rssi: u8,
26468}
26469impl RC_CHANNELS_RAW_DATA {
26470 pub const ENCODED_LEN: usize = 22usize;
26471 pub const DEFAULT: Self = Self {
26472 time_boot_ms: 0_u32,
26473 chan1_raw: 0_u16,
26474 chan2_raw: 0_u16,
26475 chan3_raw: 0_u16,
26476 chan4_raw: 0_u16,
26477 chan5_raw: 0_u16,
26478 chan6_raw: 0_u16,
26479 chan7_raw: 0_u16,
26480 chan8_raw: 0_u16,
26481 port: 0_u8,
26482 rssi: 0_u8,
26483 };
26484 #[cfg(feature = "arbitrary")]
26485 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26486 use arbitrary::{Arbitrary, Unstructured};
26487 let mut buf = [0u8; 1024];
26488 rng.fill_bytes(&mut buf);
26489 let mut unstructured = Unstructured::new(&buf);
26490 Self::arbitrary(&mut unstructured).unwrap_or_default()
26491 }
26492}
26493impl Default for RC_CHANNELS_RAW_DATA {
26494 fn default() -> Self {
26495 Self::DEFAULT.clone()
26496 }
26497}
26498impl MessageData for RC_CHANNELS_RAW_DATA {
26499 type Message = MavMessage;
26500 const ID: u32 = 35u32;
26501 const NAME: &'static str = "RC_CHANNELS_RAW";
26502 const EXTRA_CRC: u8 = 244u8;
26503 const ENCODED_LEN: usize = 22usize;
26504 fn deser(
26505 _version: MavlinkVersion,
26506 __input: &[u8],
26507 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26508 let avail_len = __input.len();
26509 let mut payload_buf = [0; Self::ENCODED_LEN];
26510 let mut buf = if avail_len < Self::ENCODED_LEN {
26511 payload_buf[0..avail_len].copy_from_slice(__input);
26512 Bytes::new(&payload_buf)
26513 } else {
26514 Bytes::new(__input)
26515 };
26516 let mut __struct = Self::default();
26517 __struct.time_boot_ms = buf.get_u32_le()?;
26518 __struct.chan1_raw = buf.get_u16_le()?;
26519 __struct.chan2_raw = buf.get_u16_le()?;
26520 __struct.chan3_raw = buf.get_u16_le()?;
26521 __struct.chan4_raw = buf.get_u16_le()?;
26522 __struct.chan5_raw = buf.get_u16_le()?;
26523 __struct.chan6_raw = buf.get_u16_le()?;
26524 __struct.chan7_raw = buf.get_u16_le()?;
26525 __struct.chan8_raw = buf.get_u16_le()?;
26526 __struct.port = buf.get_u8()?;
26527 __struct.rssi = buf.get_u8()?;
26528 Ok(__struct)
26529 }
26530 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26531 let mut __tmp = BytesMut::new(bytes);
26532 #[allow(clippy::absurd_extreme_comparisons)]
26533 #[allow(unused_comparisons)]
26534 if __tmp.remaining() < Self::ENCODED_LEN {
26535 panic!(
26536 "buffer is too small (need {} bytes, but got {})",
26537 Self::ENCODED_LEN,
26538 __tmp.remaining(),
26539 )
26540 }
26541 __tmp.put_u32_le(self.time_boot_ms);
26542 __tmp.put_u16_le(self.chan1_raw);
26543 __tmp.put_u16_le(self.chan2_raw);
26544 __tmp.put_u16_le(self.chan3_raw);
26545 __tmp.put_u16_le(self.chan4_raw);
26546 __tmp.put_u16_le(self.chan5_raw);
26547 __tmp.put_u16_le(self.chan6_raw);
26548 __tmp.put_u16_le(self.chan7_raw);
26549 __tmp.put_u16_le(self.chan8_raw);
26550 __tmp.put_u8(self.port);
26551 __tmp.put_u8(self.rssi);
26552 if matches!(version, MavlinkVersion::V2) {
26553 let len = __tmp.len();
26554 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26555 } else {
26556 __tmp.len()
26557 }
26558 }
26559}
26560#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
26561#[doc = ""]
26562#[doc = "ID: 34"]
26563#[derive(Debug, Clone, PartialEq)]
26564#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26565#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26566#[cfg_attr(feature = "ts", derive(TS))]
26567#[cfg_attr(feature = "ts", ts(export))]
26568pub struct RC_CHANNELS_SCALED_DATA {
26569 #[doc = "Timestamp (time since system boot)."]
26570 pub time_boot_ms: u32,
26571 #[doc = "RC channel 1 value scaled."]
26572 pub chan1_scaled: i16,
26573 #[doc = "RC channel 2 value scaled."]
26574 pub chan2_scaled: i16,
26575 #[doc = "RC channel 3 value scaled."]
26576 pub chan3_scaled: i16,
26577 #[doc = "RC channel 4 value scaled."]
26578 pub chan4_scaled: i16,
26579 #[doc = "RC channel 5 value scaled."]
26580 pub chan5_scaled: i16,
26581 #[doc = "RC channel 6 value scaled."]
26582 pub chan6_scaled: i16,
26583 #[doc = "RC channel 7 value scaled."]
26584 pub chan7_scaled: i16,
26585 #[doc = "RC channel 8 value scaled."]
26586 pub chan8_scaled: i16,
26587 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26588 pub port: u8,
26589 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
26590 pub rssi: u8,
26591}
26592impl RC_CHANNELS_SCALED_DATA {
26593 pub const ENCODED_LEN: usize = 22usize;
26594 pub const DEFAULT: Self = Self {
26595 time_boot_ms: 0_u32,
26596 chan1_scaled: 0_i16,
26597 chan2_scaled: 0_i16,
26598 chan3_scaled: 0_i16,
26599 chan4_scaled: 0_i16,
26600 chan5_scaled: 0_i16,
26601 chan6_scaled: 0_i16,
26602 chan7_scaled: 0_i16,
26603 chan8_scaled: 0_i16,
26604 port: 0_u8,
26605 rssi: 0_u8,
26606 };
26607 #[cfg(feature = "arbitrary")]
26608 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26609 use arbitrary::{Arbitrary, Unstructured};
26610 let mut buf = [0u8; 1024];
26611 rng.fill_bytes(&mut buf);
26612 let mut unstructured = Unstructured::new(&buf);
26613 Self::arbitrary(&mut unstructured).unwrap_or_default()
26614 }
26615}
26616impl Default for RC_CHANNELS_SCALED_DATA {
26617 fn default() -> Self {
26618 Self::DEFAULT.clone()
26619 }
26620}
26621impl MessageData for RC_CHANNELS_SCALED_DATA {
26622 type Message = MavMessage;
26623 const ID: u32 = 34u32;
26624 const NAME: &'static str = "RC_CHANNELS_SCALED";
26625 const EXTRA_CRC: u8 = 237u8;
26626 const ENCODED_LEN: usize = 22usize;
26627 fn deser(
26628 _version: MavlinkVersion,
26629 __input: &[u8],
26630 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26631 let avail_len = __input.len();
26632 let mut payload_buf = [0; Self::ENCODED_LEN];
26633 let mut buf = if avail_len < Self::ENCODED_LEN {
26634 payload_buf[0..avail_len].copy_from_slice(__input);
26635 Bytes::new(&payload_buf)
26636 } else {
26637 Bytes::new(__input)
26638 };
26639 let mut __struct = Self::default();
26640 __struct.time_boot_ms = buf.get_u32_le()?;
26641 __struct.chan1_scaled = buf.get_i16_le()?;
26642 __struct.chan2_scaled = buf.get_i16_le()?;
26643 __struct.chan3_scaled = buf.get_i16_le()?;
26644 __struct.chan4_scaled = buf.get_i16_le()?;
26645 __struct.chan5_scaled = buf.get_i16_le()?;
26646 __struct.chan6_scaled = buf.get_i16_le()?;
26647 __struct.chan7_scaled = buf.get_i16_le()?;
26648 __struct.chan8_scaled = buf.get_i16_le()?;
26649 __struct.port = buf.get_u8()?;
26650 __struct.rssi = buf.get_u8()?;
26651 Ok(__struct)
26652 }
26653 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26654 let mut __tmp = BytesMut::new(bytes);
26655 #[allow(clippy::absurd_extreme_comparisons)]
26656 #[allow(unused_comparisons)]
26657 if __tmp.remaining() < Self::ENCODED_LEN {
26658 panic!(
26659 "buffer is too small (need {} bytes, but got {})",
26660 Self::ENCODED_LEN,
26661 __tmp.remaining(),
26662 )
26663 }
26664 __tmp.put_u32_le(self.time_boot_ms);
26665 __tmp.put_i16_le(self.chan1_scaled);
26666 __tmp.put_i16_le(self.chan2_scaled);
26667 __tmp.put_i16_le(self.chan3_scaled);
26668 __tmp.put_i16_le(self.chan4_scaled);
26669 __tmp.put_i16_le(self.chan5_scaled);
26670 __tmp.put_i16_le(self.chan6_scaled);
26671 __tmp.put_i16_le(self.chan7_scaled);
26672 __tmp.put_i16_le(self.chan8_scaled);
26673 __tmp.put_u8(self.port);
26674 __tmp.put_u8(self.rssi);
26675 if matches!(version, MavlinkVersion::V2) {
26676 let len = __tmp.len();
26677 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26678 } else {
26679 __tmp.len()
26680 }
26681 }
26682}
26683#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
26684#[doc = "Request a data stream."]
26685#[doc = ""]
26686#[doc = "ID: 66"]
26687#[derive(Debug, Clone, PartialEq)]
26688#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26689#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26690#[cfg_attr(feature = "ts", derive(TS))]
26691#[cfg_attr(feature = "ts", ts(export))]
26692pub struct REQUEST_DATA_STREAM_DATA {
26693 #[doc = "The requested message rate"]
26694 pub req_message_rate: u16,
26695 #[doc = "The target requested to send the message stream."]
26696 pub target_system: u8,
26697 #[doc = "The target requested to send the message stream."]
26698 pub target_component: u8,
26699 #[doc = "The ID of the requested data stream"]
26700 pub req_stream_id: u8,
26701 #[doc = "1 to start sending, 0 to stop sending."]
26702 pub start_stop: u8,
26703}
26704impl REQUEST_DATA_STREAM_DATA {
26705 pub const ENCODED_LEN: usize = 6usize;
26706 pub const DEFAULT: Self = Self {
26707 req_message_rate: 0_u16,
26708 target_system: 0_u8,
26709 target_component: 0_u8,
26710 req_stream_id: 0_u8,
26711 start_stop: 0_u8,
26712 };
26713 #[cfg(feature = "arbitrary")]
26714 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26715 use arbitrary::{Arbitrary, Unstructured};
26716 let mut buf = [0u8; 1024];
26717 rng.fill_bytes(&mut buf);
26718 let mut unstructured = Unstructured::new(&buf);
26719 Self::arbitrary(&mut unstructured).unwrap_or_default()
26720 }
26721}
26722impl Default for REQUEST_DATA_STREAM_DATA {
26723 fn default() -> Self {
26724 Self::DEFAULT.clone()
26725 }
26726}
26727impl MessageData for REQUEST_DATA_STREAM_DATA {
26728 type Message = MavMessage;
26729 const ID: u32 = 66u32;
26730 const NAME: &'static str = "REQUEST_DATA_STREAM";
26731 const EXTRA_CRC: u8 = 148u8;
26732 const ENCODED_LEN: usize = 6usize;
26733 fn deser(
26734 _version: MavlinkVersion,
26735 __input: &[u8],
26736 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26737 let avail_len = __input.len();
26738 let mut payload_buf = [0; Self::ENCODED_LEN];
26739 let mut buf = if avail_len < Self::ENCODED_LEN {
26740 payload_buf[0..avail_len].copy_from_slice(__input);
26741 Bytes::new(&payload_buf)
26742 } else {
26743 Bytes::new(__input)
26744 };
26745 let mut __struct = Self::default();
26746 __struct.req_message_rate = buf.get_u16_le()?;
26747 __struct.target_system = buf.get_u8()?;
26748 __struct.target_component = buf.get_u8()?;
26749 __struct.req_stream_id = buf.get_u8()?;
26750 __struct.start_stop = buf.get_u8()?;
26751 Ok(__struct)
26752 }
26753 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26754 let mut __tmp = BytesMut::new(bytes);
26755 #[allow(clippy::absurd_extreme_comparisons)]
26756 #[allow(unused_comparisons)]
26757 if __tmp.remaining() < Self::ENCODED_LEN {
26758 panic!(
26759 "buffer is too small (need {} bytes, but got {})",
26760 Self::ENCODED_LEN,
26761 __tmp.remaining(),
26762 )
26763 }
26764 __tmp.put_u16_le(self.req_message_rate);
26765 __tmp.put_u8(self.target_system);
26766 __tmp.put_u8(self.target_component);
26767 __tmp.put_u8(self.req_stream_id);
26768 __tmp.put_u8(self.start_stop);
26769 if matches!(version, MavlinkVersion::V2) {
26770 let len = __tmp.len();
26771 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26772 } else {
26773 __tmp.len()
26774 }
26775 }
26776}
26777#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
26778#[doc = ""]
26779#[doc = "ID: 412"]
26780#[derive(Debug, Clone, PartialEq)]
26781#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26782#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26783#[cfg_attr(feature = "ts", derive(TS))]
26784#[cfg_attr(feature = "ts", ts(export))]
26785pub struct REQUEST_EVENT_DATA {
26786 #[doc = "First sequence number of the requested event."]
26787 pub first_sequence: u16,
26788 #[doc = "Last sequence number of the requested event."]
26789 pub last_sequence: u16,
26790 #[doc = "System ID"]
26791 pub target_system: u8,
26792 #[doc = "Component ID"]
26793 pub target_component: u8,
26794}
26795impl REQUEST_EVENT_DATA {
26796 pub const ENCODED_LEN: usize = 6usize;
26797 pub const DEFAULT: Self = Self {
26798 first_sequence: 0_u16,
26799 last_sequence: 0_u16,
26800 target_system: 0_u8,
26801 target_component: 0_u8,
26802 };
26803 #[cfg(feature = "arbitrary")]
26804 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26805 use arbitrary::{Arbitrary, Unstructured};
26806 let mut buf = [0u8; 1024];
26807 rng.fill_bytes(&mut buf);
26808 let mut unstructured = Unstructured::new(&buf);
26809 Self::arbitrary(&mut unstructured).unwrap_or_default()
26810 }
26811}
26812impl Default for REQUEST_EVENT_DATA {
26813 fn default() -> Self {
26814 Self::DEFAULT.clone()
26815 }
26816}
26817impl MessageData for REQUEST_EVENT_DATA {
26818 type Message = MavMessage;
26819 const ID: u32 = 412u32;
26820 const NAME: &'static str = "REQUEST_EVENT";
26821 const EXTRA_CRC: u8 = 33u8;
26822 const ENCODED_LEN: usize = 6usize;
26823 fn deser(
26824 _version: MavlinkVersion,
26825 __input: &[u8],
26826 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26827 let avail_len = __input.len();
26828 let mut payload_buf = [0; Self::ENCODED_LEN];
26829 let mut buf = if avail_len < Self::ENCODED_LEN {
26830 payload_buf[0..avail_len].copy_from_slice(__input);
26831 Bytes::new(&payload_buf)
26832 } else {
26833 Bytes::new(__input)
26834 };
26835 let mut __struct = Self::default();
26836 __struct.first_sequence = buf.get_u16_le()?;
26837 __struct.last_sequence = buf.get_u16_le()?;
26838 __struct.target_system = buf.get_u8()?;
26839 __struct.target_component = buf.get_u8()?;
26840 Ok(__struct)
26841 }
26842 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26843 let mut __tmp = BytesMut::new(bytes);
26844 #[allow(clippy::absurd_extreme_comparisons)]
26845 #[allow(unused_comparisons)]
26846 if __tmp.remaining() < Self::ENCODED_LEN {
26847 panic!(
26848 "buffer is too small (need {} bytes, but got {})",
26849 Self::ENCODED_LEN,
26850 __tmp.remaining(),
26851 )
26852 }
26853 __tmp.put_u16_le(self.first_sequence);
26854 __tmp.put_u16_le(self.last_sequence);
26855 __tmp.put_u8(self.target_system);
26856 __tmp.put_u8(self.target_component);
26857 if matches!(version, MavlinkVersion::V2) {
26858 let len = __tmp.len();
26859 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26860 } else {
26861 __tmp.len()
26862 }
26863 }
26864}
26865#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
26866#[doc = ""]
26867#[doc = "ID: 142"]
26868#[derive(Debug, Clone, PartialEq)]
26869#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26870#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26871#[cfg_attr(feature = "ts", derive(TS))]
26872#[cfg_attr(feature = "ts", ts(export))]
26873pub struct RESOURCE_REQUEST_DATA {
26874 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
26875 pub request_id: u8,
26876 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
26877 pub uri_type: u8,
26878 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
26879 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26880 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26881 pub uri: [u8; 120],
26882 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
26883 pub transfer_type: u8,
26884 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
26885 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26886 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
26887 pub storage: [u8; 120],
26888}
26889impl RESOURCE_REQUEST_DATA {
26890 pub const ENCODED_LEN: usize = 243usize;
26891 pub const DEFAULT: Self = Self {
26892 request_id: 0_u8,
26893 uri_type: 0_u8,
26894 uri: [0_u8; 120usize],
26895 transfer_type: 0_u8,
26896 storage: [0_u8; 120usize],
26897 };
26898 #[cfg(feature = "arbitrary")]
26899 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26900 use arbitrary::{Arbitrary, Unstructured};
26901 let mut buf = [0u8; 1024];
26902 rng.fill_bytes(&mut buf);
26903 let mut unstructured = Unstructured::new(&buf);
26904 Self::arbitrary(&mut unstructured).unwrap_or_default()
26905 }
26906}
26907impl Default for RESOURCE_REQUEST_DATA {
26908 fn default() -> Self {
26909 Self::DEFAULT.clone()
26910 }
26911}
26912impl MessageData for RESOURCE_REQUEST_DATA {
26913 type Message = MavMessage;
26914 const ID: u32 = 142u32;
26915 const NAME: &'static str = "RESOURCE_REQUEST";
26916 const EXTRA_CRC: u8 = 72u8;
26917 const ENCODED_LEN: usize = 243usize;
26918 fn deser(
26919 _version: MavlinkVersion,
26920 __input: &[u8],
26921 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26922 let avail_len = __input.len();
26923 let mut payload_buf = [0; Self::ENCODED_LEN];
26924 let mut buf = if avail_len < Self::ENCODED_LEN {
26925 payload_buf[0..avail_len].copy_from_slice(__input);
26926 Bytes::new(&payload_buf)
26927 } else {
26928 Bytes::new(__input)
26929 };
26930 let mut __struct = Self::default();
26931 __struct.request_id = buf.get_u8()?;
26932 __struct.uri_type = buf.get_u8()?;
26933 for v in &mut __struct.uri {
26934 let val = buf.get_u8()?;
26935 *v = val;
26936 }
26937 __struct.transfer_type = buf.get_u8()?;
26938 for v in &mut __struct.storage {
26939 let val = buf.get_u8()?;
26940 *v = val;
26941 }
26942 Ok(__struct)
26943 }
26944 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26945 let mut __tmp = BytesMut::new(bytes);
26946 #[allow(clippy::absurd_extreme_comparisons)]
26947 #[allow(unused_comparisons)]
26948 if __tmp.remaining() < Self::ENCODED_LEN {
26949 panic!(
26950 "buffer is too small (need {} bytes, but got {})",
26951 Self::ENCODED_LEN,
26952 __tmp.remaining(),
26953 )
26954 }
26955 __tmp.put_u8(self.request_id);
26956 __tmp.put_u8(self.uri_type);
26957 for val in &self.uri {
26958 __tmp.put_u8(*val);
26959 }
26960 __tmp.put_u8(self.transfer_type);
26961 for val in &self.storage {
26962 __tmp.put_u8(*val);
26963 }
26964 if matches!(version, MavlinkVersion::V2) {
26965 let len = __tmp.len();
26966 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26967 } else {
26968 __tmp.len()
26969 }
26970 }
26971}
26972#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
26973#[doc = ""]
26974#[doc = "ID: 413"]
26975#[derive(Debug, Clone, PartialEq)]
26976#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26977#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26978#[cfg_attr(feature = "ts", derive(TS))]
26979#[cfg_attr(feature = "ts", ts(export))]
26980pub struct RESPONSE_EVENT_ERROR_DATA {
26981 #[doc = "Sequence number."]
26982 pub sequence: u16,
26983 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
26984 pub sequence_oldest_available: u16,
26985 #[doc = "System ID"]
26986 pub target_system: u8,
26987 #[doc = "Component ID"]
26988 pub target_component: u8,
26989 #[doc = "Error reason."]
26990 pub reason: MavEventErrorReason,
26991}
26992impl RESPONSE_EVENT_ERROR_DATA {
26993 pub const ENCODED_LEN: usize = 7usize;
26994 pub const DEFAULT: Self = Self {
26995 sequence: 0_u16,
26996 sequence_oldest_available: 0_u16,
26997 target_system: 0_u8,
26998 target_component: 0_u8,
26999 reason: MavEventErrorReason::DEFAULT,
27000 };
27001 #[cfg(feature = "arbitrary")]
27002 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27003 use arbitrary::{Arbitrary, Unstructured};
27004 let mut buf = [0u8; 1024];
27005 rng.fill_bytes(&mut buf);
27006 let mut unstructured = Unstructured::new(&buf);
27007 Self::arbitrary(&mut unstructured).unwrap_or_default()
27008 }
27009}
27010impl Default for RESPONSE_EVENT_ERROR_DATA {
27011 fn default() -> Self {
27012 Self::DEFAULT.clone()
27013 }
27014}
27015impl MessageData for RESPONSE_EVENT_ERROR_DATA {
27016 type Message = MavMessage;
27017 const ID: u32 = 413u32;
27018 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
27019 const EXTRA_CRC: u8 = 77u8;
27020 const ENCODED_LEN: usize = 7usize;
27021 fn deser(
27022 _version: MavlinkVersion,
27023 __input: &[u8],
27024 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27025 let avail_len = __input.len();
27026 let mut payload_buf = [0; Self::ENCODED_LEN];
27027 let mut buf = if avail_len < Self::ENCODED_LEN {
27028 payload_buf[0..avail_len].copy_from_slice(__input);
27029 Bytes::new(&payload_buf)
27030 } else {
27031 Bytes::new(__input)
27032 };
27033 let mut __struct = Self::default();
27034 __struct.sequence = buf.get_u16_le()?;
27035 __struct.sequence_oldest_available = buf.get_u16_le()?;
27036 __struct.target_system = buf.get_u8()?;
27037 __struct.target_component = buf.get_u8()?;
27038 let tmp = buf.get_u8()?;
27039 __struct.reason =
27040 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27041 enum_type: "MavEventErrorReason",
27042 value: tmp as u64,
27043 })?;
27044 Ok(__struct)
27045 }
27046 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27047 let mut __tmp = BytesMut::new(bytes);
27048 #[allow(clippy::absurd_extreme_comparisons)]
27049 #[allow(unused_comparisons)]
27050 if __tmp.remaining() < Self::ENCODED_LEN {
27051 panic!(
27052 "buffer is too small (need {} bytes, but got {})",
27053 Self::ENCODED_LEN,
27054 __tmp.remaining(),
27055 )
27056 }
27057 __tmp.put_u16_le(self.sequence);
27058 __tmp.put_u16_le(self.sequence_oldest_available);
27059 __tmp.put_u8(self.target_system);
27060 __tmp.put_u8(self.target_component);
27061 __tmp.put_u8(self.reason as u8);
27062 if matches!(version, MavlinkVersion::V2) {
27063 let len = __tmp.len();
27064 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27065 } else {
27066 __tmp.len()
27067 }
27068 }
27069}
27070#[doc = "Read out the safety zone the MAV currently assumes."]
27071#[doc = ""]
27072#[doc = "ID: 55"]
27073#[derive(Debug, Clone, PartialEq)]
27074#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27075#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27076#[cfg_attr(feature = "ts", derive(TS))]
27077#[cfg_attr(feature = "ts", ts(export))]
27078pub struct SAFETY_ALLOWED_AREA_DATA {
27079 #[doc = "x position 1 / Latitude 1"]
27080 pub p1x: f32,
27081 #[doc = "y position 1 / Longitude 1"]
27082 pub p1y: f32,
27083 #[doc = "z position 1 / Altitude 1"]
27084 pub p1z: f32,
27085 #[doc = "x position 2 / Latitude 2"]
27086 pub p2x: f32,
27087 #[doc = "y position 2 / Longitude 2"]
27088 pub p2y: f32,
27089 #[doc = "z position 2 / Altitude 2"]
27090 pub p2z: f32,
27091 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
27092 pub frame: MavFrame,
27093}
27094impl SAFETY_ALLOWED_AREA_DATA {
27095 pub const ENCODED_LEN: usize = 25usize;
27096 pub const DEFAULT: Self = Self {
27097 p1x: 0.0_f32,
27098 p1y: 0.0_f32,
27099 p1z: 0.0_f32,
27100 p2x: 0.0_f32,
27101 p2y: 0.0_f32,
27102 p2z: 0.0_f32,
27103 frame: MavFrame::DEFAULT,
27104 };
27105 #[cfg(feature = "arbitrary")]
27106 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27107 use arbitrary::{Arbitrary, Unstructured};
27108 let mut buf = [0u8; 1024];
27109 rng.fill_bytes(&mut buf);
27110 let mut unstructured = Unstructured::new(&buf);
27111 Self::arbitrary(&mut unstructured).unwrap_or_default()
27112 }
27113}
27114impl Default for SAFETY_ALLOWED_AREA_DATA {
27115 fn default() -> Self {
27116 Self::DEFAULT.clone()
27117 }
27118}
27119impl MessageData for SAFETY_ALLOWED_AREA_DATA {
27120 type Message = MavMessage;
27121 const ID: u32 = 55u32;
27122 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
27123 const EXTRA_CRC: u8 = 3u8;
27124 const ENCODED_LEN: usize = 25usize;
27125 fn deser(
27126 _version: MavlinkVersion,
27127 __input: &[u8],
27128 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27129 let avail_len = __input.len();
27130 let mut payload_buf = [0; Self::ENCODED_LEN];
27131 let mut buf = if avail_len < Self::ENCODED_LEN {
27132 payload_buf[0..avail_len].copy_from_slice(__input);
27133 Bytes::new(&payload_buf)
27134 } else {
27135 Bytes::new(__input)
27136 };
27137 let mut __struct = Self::default();
27138 __struct.p1x = buf.get_f32_le()?;
27139 __struct.p1y = buf.get_f32_le()?;
27140 __struct.p1z = buf.get_f32_le()?;
27141 __struct.p2x = buf.get_f32_le()?;
27142 __struct.p2y = buf.get_f32_le()?;
27143 __struct.p2z = buf.get_f32_le()?;
27144 let tmp = buf.get_u8()?;
27145 __struct.frame =
27146 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27147 enum_type: "MavFrame",
27148 value: tmp as u64,
27149 })?;
27150 Ok(__struct)
27151 }
27152 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27153 let mut __tmp = BytesMut::new(bytes);
27154 #[allow(clippy::absurd_extreme_comparisons)]
27155 #[allow(unused_comparisons)]
27156 if __tmp.remaining() < Self::ENCODED_LEN {
27157 panic!(
27158 "buffer is too small (need {} bytes, but got {})",
27159 Self::ENCODED_LEN,
27160 __tmp.remaining(),
27161 )
27162 }
27163 __tmp.put_f32_le(self.p1x);
27164 __tmp.put_f32_le(self.p1y);
27165 __tmp.put_f32_le(self.p1z);
27166 __tmp.put_f32_le(self.p2x);
27167 __tmp.put_f32_le(self.p2y);
27168 __tmp.put_f32_le(self.p2z);
27169 __tmp.put_u8(self.frame as u8);
27170 if matches!(version, MavlinkVersion::V2) {
27171 let len = __tmp.len();
27172 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27173 } else {
27174 __tmp.len()
27175 }
27176 }
27177}
27178#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
27179#[doc = ""]
27180#[doc = "ID: 54"]
27181#[derive(Debug, Clone, PartialEq)]
27182#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27183#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27184#[cfg_attr(feature = "ts", derive(TS))]
27185#[cfg_attr(feature = "ts", ts(export))]
27186pub struct SAFETY_SET_ALLOWED_AREA_DATA {
27187 #[doc = "x position 1 / Latitude 1"]
27188 pub p1x: f32,
27189 #[doc = "y position 1 / Longitude 1"]
27190 pub p1y: f32,
27191 #[doc = "z position 1 / Altitude 1"]
27192 pub p1z: f32,
27193 #[doc = "x position 2 / Latitude 2"]
27194 pub p2x: f32,
27195 #[doc = "y position 2 / Longitude 2"]
27196 pub p2y: f32,
27197 #[doc = "z position 2 / Altitude 2"]
27198 pub p2z: f32,
27199 #[doc = "System ID"]
27200 pub target_system: u8,
27201 #[doc = "Component ID"]
27202 pub target_component: u8,
27203 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
27204 pub frame: MavFrame,
27205}
27206impl SAFETY_SET_ALLOWED_AREA_DATA {
27207 pub const ENCODED_LEN: usize = 27usize;
27208 pub const DEFAULT: Self = Self {
27209 p1x: 0.0_f32,
27210 p1y: 0.0_f32,
27211 p1z: 0.0_f32,
27212 p2x: 0.0_f32,
27213 p2y: 0.0_f32,
27214 p2z: 0.0_f32,
27215 target_system: 0_u8,
27216 target_component: 0_u8,
27217 frame: MavFrame::DEFAULT,
27218 };
27219 #[cfg(feature = "arbitrary")]
27220 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27221 use arbitrary::{Arbitrary, Unstructured};
27222 let mut buf = [0u8; 1024];
27223 rng.fill_bytes(&mut buf);
27224 let mut unstructured = Unstructured::new(&buf);
27225 Self::arbitrary(&mut unstructured).unwrap_or_default()
27226 }
27227}
27228impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
27229 fn default() -> Self {
27230 Self::DEFAULT.clone()
27231 }
27232}
27233impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
27234 type Message = MavMessage;
27235 const ID: u32 = 54u32;
27236 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
27237 const EXTRA_CRC: u8 = 15u8;
27238 const ENCODED_LEN: usize = 27usize;
27239 fn deser(
27240 _version: MavlinkVersion,
27241 __input: &[u8],
27242 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27243 let avail_len = __input.len();
27244 let mut payload_buf = [0; Self::ENCODED_LEN];
27245 let mut buf = if avail_len < Self::ENCODED_LEN {
27246 payload_buf[0..avail_len].copy_from_slice(__input);
27247 Bytes::new(&payload_buf)
27248 } else {
27249 Bytes::new(__input)
27250 };
27251 let mut __struct = Self::default();
27252 __struct.p1x = buf.get_f32_le()?;
27253 __struct.p1y = buf.get_f32_le()?;
27254 __struct.p1z = buf.get_f32_le()?;
27255 __struct.p2x = buf.get_f32_le()?;
27256 __struct.p2y = buf.get_f32_le()?;
27257 __struct.p2z = buf.get_f32_le()?;
27258 __struct.target_system = buf.get_u8()?;
27259 __struct.target_component = buf.get_u8()?;
27260 let tmp = buf.get_u8()?;
27261 __struct.frame =
27262 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27263 enum_type: "MavFrame",
27264 value: tmp as u64,
27265 })?;
27266 Ok(__struct)
27267 }
27268 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27269 let mut __tmp = BytesMut::new(bytes);
27270 #[allow(clippy::absurd_extreme_comparisons)]
27271 #[allow(unused_comparisons)]
27272 if __tmp.remaining() < Self::ENCODED_LEN {
27273 panic!(
27274 "buffer is too small (need {} bytes, but got {})",
27275 Self::ENCODED_LEN,
27276 __tmp.remaining(),
27277 )
27278 }
27279 __tmp.put_f32_le(self.p1x);
27280 __tmp.put_f32_le(self.p1y);
27281 __tmp.put_f32_le(self.p1z);
27282 __tmp.put_f32_le(self.p2x);
27283 __tmp.put_f32_le(self.p2y);
27284 __tmp.put_f32_le(self.p2z);
27285 __tmp.put_u8(self.target_system);
27286 __tmp.put_u8(self.target_component);
27287 __tmp.put_u8(self.frame as u8);
27288 if matches!(version, MavlinkVersion::V2) {
27289 let len = __tmp.len();
27290 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27291 } else {
27292 __tmp.len()
27293 }
27294 }
27295}
27296#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
27297#[doc = ""]
27298#[doc = "ID: 26"]
27299#[derive(Debug, Clone, PartialEq)]
27300#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27301#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27302#[cfg_attr(feature = "ts", derive(TS))]
27303#[cfg_attr(feature = "ts", ts(export))]
27304pub struct SCALED_IMU_DATA {
27305 #[doc = "Timestamp (time since system boot)."]
27306 pub time_boot_ms: u32,
27307 #[doc = "X acceleration"]
27308 pub xacc: i16,
27309 #[doc = "Y acceleration"]
27310 pub yacc: i16,
27311 #[doc = "Z acceleration"]
27312 pub zacc: i16,
27313 #[doc = "Angular speed around X axis"]
27314 pub xgyro: i16,
27315 #[doc = "Angular speed around Y axis"]
27316 pub ygyro: i16,
27317 #[doc = "Angular speed around Z axis"]
27318 pub zgyro: i16,
27319 #[doc = "X Magnetic field"]
27320 pub xmag: i16,
27321 #[doc = "Y Magnetic field"]
27322 pub ymag: i16,
27323 #[doc = "Z Magnetic field"]
27324 pub zmag: i16,
27325 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27326 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27327 pub temperature: i16,
27328}
27329impl SCALED_IMU_DATA {
27330 pub const ENCODED_LEN: usize = 24usize;
27331 pub const DEFAULT: Self = Self {
27332 time_boot_ms: 0_u32,
27333 xacc: 0_i16,
27334 yacc: 0_i16,
27335 zacc: 0_i16,
27336 xgyro: 0_i16,
27337 ygyro: 0_i16,
27338 zgyro: 0_i16,
27339 xmag: 0_i16,
27340 ymag: 0_i16,
27341 zmag: 0_i16,
27342 temperature: 0_i16,
27343 };
27344 #[cfg(feature = "arbitrary")]
27345 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27346 use arbitrary::{Arbitrary, Unstructured};
27347 let mut buf = [0u8; 1024];
27348 rng.fill_bytes(&mut buf);
27349 let mut unstructured = Unstructured::new(&buf);
27350 Self::arbitrary(&mut unstructured).unwrap_or_default()
27351 }
27352}
27353impl Default for SCALED_IMU_DATA {
27354 fn default() -> Self {
27355 Self::DEFAULT.clone()
27356 }
27357}
27358impl MessageData for SCALED_IMU_DATA {
27359 type Message = MavMessage;
27360 const ID: u32 = 26u32;
27361 const NAME: &'static str = "SCALED_IMU";
27362 const EXTRA_CRC: u8 = 170u8;
27363 const ENCODED_LEN: usize = 24usize;
27364 fn deser(
27365 _version: MavlinkVersion,
27366 __input: &[u8],
27367 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27368 let avail_len = __input.len();
27369 let mut payload_buf = [0; Self::ENCODED_LEN];
27370 let mut buf = if avail_len < Self::ENCODED_LEN {
27371 payload_buf[0..avail_len].copy_from_slice(__input);
27372 Bytes::new(&payload_buf)
27373 } else {
27374 Bytes::new(__input)
27375 };
27376 let mut __struct = Self::default();
27377 __struct.time_boot_ms = buf.get_u32_le()?;
27378 __struct.xacc = buf.get_i16_le()?;
27379 __struct.yacc = buf.get_i16_le()?;
27380 __struct.zacc = buf.get_i16_le()?;
27381 __struct.xgyro = buf.get_i16_le()?;
27382 __struct.ygyro = buf.get_i16_le()?;
27383 __struct.zgyro = buf.get_i16_le()?;
27384 __struct.xmag = buf.get_i16_le()?;
27385 __struct.ymag = buf.get_i16_le()?;
27386 __struct.zmag = buf.get_i16_le()?;
27387 __struct.temperature = buf.get_i16_le()?;
27388 Ok(__struct)
27389 }
27390 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27391 let mut __tmp = BytesMut::new(bytes);
27392 #[allow(clippy::absurd_extreme_comparisons)]
27393 #[allow(unused_comparisons)]
27394 if __tmp.remaining() < Self::ENCODED_LEN {
27395 panic!(
27396 "buffer is too small (need {} bytes, but got {})",
27397 Self::ENCODED_LEN,
27398 __tmp.remaining(),
27399 )
27400 }
27401 __tmp.put_u32_le(self.time_boot_ms);
27402 __tmp.put_i16_le(self.xacc);
27403 __tmp.put_i16_le(self.yacc);
27404 __tmp.put_i16_le(self.zacc);
27405 __tmp.put_i16_le(self.xgyro);
27406 __tmp.put_i16_le(self.ygyro);
27407 __tmp.put_i16_le(self.zgyro);
27408 __tmp.put_i16_le(self.xmag);
27409 __tmp.put_i16_le(self.ymag);
27410 __tmp.put_i16_le(self.zmag);
27411 if matches!(version, MavlinkVersion::V2) {
27412 __tmp.put_i16_le(self.temperature);
27413 let len = __tmp.len();
27414 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27415 } else {
27416 __tmp.len()
27417 }
27418 }
27419}
27420#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
27421#[doc = ""]
27422#[doc = "ID: 116"]
27423#[derive(Debug, Clone, PartialEq)]
27424#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27425#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27426#[cfg_attr(feature = "ts", derive(TS))]
27427#[cfg_attr(feature = "ts", ts(export))]
27428pub struct SCALED_IMU2_DATA {
27429 #[doc = "Timestamp (time since system boot)."]
27430 pub time_boot_ms: u32,
27431 #[doc = "X acceleration"]
27432 pub xacc: i16,
27433 #[doc = "Y acceleration"]
27434 pub yacc: i16,
27435 #[doc = "Z acceleration"]
27436 pub zacc: i16,
27437 #[doc = "Angular speed around X axis"]
27438 pub xgyro: i16,
27439 #[doc = "Angular speed around Y axis"]
27440 pub ygyro: i16,
27441 #[doc = "Angular speed around Z axis"]
27442 pub zgyro: i16,
27443 #[doc = "X Magnetic field"]
27444 pub xmag: i16,
27445 #[doc = "Y Magnetic field"]
27446 pub ymag: i16,
27447 #[doc = "Z Magnetic field"]
27448 pub zmag: i16,
27449 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27450 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27451 pub temperature: i16,
27452}
27453impl SCALED_IMU2_DATA {
27454 pub const ENCODED_LEN: usize = 24usize;
27455 pub const DEFAULT: Self = Self {
27456 time_boot_ms: 0_u32,
27457 xacc: 0_i16,
27458 yacc: 0_i16,
27459 zacc: 0_i16,
27460 xgyro: 0_i16,
27461 ygyro: 0_i16,
27462 zgyro: 0_i16,
27463 xmag: 0_i16,
27464 ymag: 0_i16,
27465 zmag: 0_i16,
27466 temperature: 0_i16,
27467 };
27468 #[cfg(feature = "arbitrary")]
27469 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27470 use arbitrary::{Arbitrary, Unstructured};
27471 let mut buf = [0u8; 1024];
27472 rng.fill_bytes(&mut buf);
27473 let mut unstructured = Unstructured::new(&buf);
27474 Self::arbitrary(&mut unstructured).unwrap_or_default()
27475 }
27476}
27477impl Default for SCALED_IMU2_DATA {
27478 fn default() -> Self {
27479 Self::DEFAULT.clone()
27480 }
27481}
27482impl MessageData for SCALED_IMU2_DATA {
27483 type Message = MavMessage;
27484 const ID: u32 = 116u32;
27485 const NAME: &'static str = "SCALED_IMU2";
27486 const EXTRA_CRC: u8 = 76u8;
27487 const ENCODED_LEN: usize = 24usize;
27488 fn deser(
27489 _version: MavlinkVersion,
27490 __input: &[u8],
27491 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27492 let avail_len = __input.len();
27493 let mut payload_buf = [0; Self::ENCODED_LEN];
27494 let mut buf = if avail_len < Self::ENCODED_LEN {
27495 payload_buf[0..avail_len].copy_from_slice(__input);
27496 Bytes::new(&payload_buf)
27497 } else {
27498 Bytes::new(__input)
27499 };
27500 let mut __struct = Self::default();
27501 __struct.time_boot_ms = buf.get_u32_le()?;
27502 __struct.xacc = buf.get_i16_le()?;
27503 __struct.yacc = buf.get_i16_le()?;
27504 __struct.zacc = buf.get_i16_le()?;
27505 __struct.xgyro = buf.get_i16_le()?;
27506 __struct.ygyro = buf.get_i16_le()?;
27507 __struct.zgyro = buf.get_i16_le()?;
27508 __struct.xmag = buf.get_i16_le()?;
27509 __struct.ymag = buf.get_i16_le()?;
27510 __struct.zmag = buf.get_i16_le()?;
27511 __struct.temperature = buf.get_i16_le()?;
27512 Ok(__struct)
27513 }
27514 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27515 let mut __tmp = BytesMut::new(bytes);
27516 #[allow(clippy::absurd_extreme_comparisons)]
27517 #[allow(unused_comparisons)]
27518 if __tmp.remaining() < Self::ENCODED_LEN {
27519 panic!(
27520 "buffer is too small (need {} bytes, but got {})",
27521 Self::ENCODED_LEN,
27522 __tmp.remaining(),
27523 )
27524 }
27525 __tmp.put_u32_le(self.time_boot_ms);
27526 __tmp.put_i16_le(self.xacc);
27527 __tmp.put_i16_le(self.yacc);
27528 __tmp.put_i16_le(self.zacc);
27529 __tmp.put_i16_le(self.xgyro);
27530 __tmp.put_i16_le(self.ygyro);
27531 __tmp.put_i16_le(self.zgyro);
27532 __tmp.put_i16_le(self.xmag);
27533 __tmp.put_i16_le(self.ymag);
27534 __tmp.put_i16_le(self.zmag);
27535 if matches!(version, MavlinkVersion::V2) {
27536 __tmp.put_i16_le(self.temperature);
27537 let len = __tmp.len();
27538 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27539 } else {
27540 __tmp.len()
27541 }
27542 }
27543}
27544#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
27545#[doc = ""]
27546#[doc = "ID: 129"]
27547#[derive(Debug, Clone, PartialEq)]
27548#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27549#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27550#[cfg_attr(feature = "ts", derive(TS))]
27551#[cfg_attr(feature = "ts", ts(export))]
27552pub struct SCALED_IMU3_DATA {
27553 #[doc = "Timestamp (time since system boot)."]
27554 pub time_boot_ms: u32,
27555 #[doc = "X acceleration"]
27556 pub xacc: i16,
27557 #[doc = "Y acceleration"]
27558 pub yacc: i16,
27559 #[doc = "Z acceleration"]
27560 pub zacc: i16,
27561 #[doc = "Angular speed around X axis"]
27562 pub xgyro: i16,
27563 #[doc = "Angular speed around Y axis"]
27564 pub ygyro: i16,
27565 #[doc = "Angular speed around Z axis"]
27566 pub zgyro: i16,
27567 #[doc = "X Magnetic field"]
27568 pub xmag: i16,
27569 #[doc = "Y Magnetic field"]
27570 pub ymag: i16,
27571 #[doc = "Z Magnetic field"]
27572 pub zmag: i16,
27573 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
27574 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27575 pub temperature: i16,
27576}
27577impl SCALED_IMU3_DATA {
27578 pub const ENCODED_LEN: usize = 24usize;
27579 pub const DEFAULT: Self = Self {
27580 time_boot_ms: 0_u32,
27581 xacc: 0_i16,
27582 yacc: 0_i16,
27583 zacc: 0_i16,
27584 xgyro: 0_i16,
27585 ygyro: 0_i16,
27586 zgyro: 0_i16,
27587 xmag: 0_i16,
27588 ymag: 0_i16,
27589 zmag: 0_i16,
27590 temperature: 0_i16,
27591 };
27592 #[cfg(feature = "arbitrary")]
27593 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27594 use arbitrary::{Arbitrary, Unstructured};
27595 let mut buf = [0u8; 1024];
27596 rng.fill_bytes(&mut buf);
27597 let mut unstructured = Unstructured::new(&buf);
27598 Self::arbitrary(&mut unstructured).unwrap_or_default()
27599 }
27600}
27601impl Default for SCALED_IMU3_DATA {
27602 fn default() -> Self {
27603 Self::DEFAULT.clone()
27604 }
27605}
27606impl MessageData for SCALED_IMU3_DATA {
27607 type Message = MavMessage;
27608 const ID: u32 = 129u32;
27609 const NAME: &'static str = "SCALED_IMU3";
27610 const EXTRA_CRC: u8 = 46u8;
27611 const ENCODED_LEN: usize = 24usize;
27612 fn deser(
27613 _version: MavlinkVersion,
27614 __input: &[u8],
27615 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27616 let avail_len = __input.len();
27617 let mut payload_buf = [0; Self::ENCODED_LEN];
27618 let mut buf = if avail_len < Self::ENCODED_LEN {
27619 payload_buf[0..avail_len].copy_from_slice(__input);
27620 Bytes::new(&payload_buf)
27621 } else {
27622 Bytes::new(__input)
27623 };
27624 let mut __struct = Self::default();
27625 __struct.time_boot_ms = buf.get_u32_le()?;
27626 __struct.xacc = buf.get_i16_le()?;
27627 __struct.yacc = buf.get_i16_le()?;
27628 __struct.zacc = buf.get_i16_le()?;
27629 __struct.xgyro = buf.get_i16_le()?;
27630 __struct.ygyro = buf.get_i16_le()?;
27631 __struct.zgyro = buf.get_i16_le()?;
27632 __struct.xmag = buf.get_i16_le()?;
27633 __struct.ymag = buf.get_i16_le()?;
27634 __struct.zmag = buf.get_i16_le()?;
27635 __struct.temperature = buf.get_i16_le()?;
27636 Ok(__struct)
27637 }
27638 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27639 let mut __tmp = BytesMut::new(bytes);
27640 #[allow(clippy::absurd_extreme_comparisons)]
27641 #[allow(unused_comparisons)]
27642 if __tmp.remaining() < Self::ENCODED_LEN {
27643 panic!(
27644 "buffer is too small (need {} bytes, but got {})",
27645 Self::ENCODED_LEN,
27646 __tmp.remaining(),
27647 )
27648 }
27649 __tmp.put_u32_le(self.time_boot_ms);
27650 __tmp.put_i16_le(self.xacc);
27651 __tmp.put_i16_le(self.yacc);
27652 __tmp.put_i16_le(self.zacc);
27653 __tmp.put_i16_le(self.xgyro);
27654 __tmp.put_i16_le(self.ygyro);
27655 __tmp.put_i16_le(self.zgyro);
27656 __tmp.put_i16_le(self.xmag);
27657 __tmp.put_i16_le(self.ymag);
27658 __tmp.put_i16_le(self.zmag);
27659 if matches!(version, MavlinkVersion::V2) {
27660 __tmp.put_i16_le(self.temperature);
27661 let len = __tmp.len();
27662 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27663 } else {
27664 __tmp.len()
27665 }
27666 }
27667}
27668#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
27669#[doc = ""]
27670#[doc = "ID: 29"]
27671#[derive(Debug, Clone, PartialEq)]
27672#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27673#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27674#[cfg_attr(feature = "ts", derive(TS))]
27675#[cfg_attr(feature = "ts", ts(export))]
27676pub struct SCALED_PRESSURE_DATA {
27677 #[doc = "Timestamp (time since system boot)."]
27678 pub time_boot_ms: u32,
27679 #[doc = "Absolute pressure"]
27680 pub press_abs: f32,
27681 #[doc = "Differential pressure 1"]
27682 pub press_diff: f32,
27683 #[doc = "Absolute pressure temperature"]
27684 pub temperature: i16,
27685 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27686 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27687 pub temperature_press_diff: i16,
27688}
27689impl SCALED_PRESSURE_DATA {
27690 pub const ENCODED_LEN: usize = 16usize;
27691 pub const DEFAULT: Self = Self {
27692 time_boot_ms: 0_u32,
27693 press_abs: 0.0_f32,
27694 press_diff: 0.0_f32,
27695 temperature: 0_i16,
27696 temperature_press_diff: 0_i16,
27697 };
27698 #[cfg(feature = "arbitrary")]
27699 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27700 use arbitrary::{Arbitrary, Unstructured};
27701 let mut buf = [0u8; 1024];
27702 rng.fill_bytes(&mut buf);
27703 let mut unstructured = Unstructured::new(&buf);
27704 Self::arbitrary(&mut unstructured).unwrap_or_default()
27705 }
27706}
27707impl Default for SCALED_PRESSURE_DATA {
27708 fn default() -> Self {
27709 Self::DEFAULT.clone()
27710 }
27711}
27712impl MessageData for SCALED_PRESSURE_DATA {
27713 type Message = MavMessage;
27714 const ID: u32 = 29u32;
27715 const NAME: &'static str = "SCALED_PRESSURE";
27716 const EXTRA_CRC: u8 = 115u8;
27717 const ENCODED_LEN: usize = 16usize;
27718 fn deser(
27719 _version: MavlinkVersion,
27720 __input: &[u8],
27721 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27722 let avail_len = __input.len();
27723 let mut payload_buf = [0; Self::ENCODED_LEN];
27724 let mut buf = if avail_len < Self::ENCODED_LEN {
27725 payload_buf[0..avail_len].copy_from_slice(__input);
27726 Bytes::new(&payload_buf)
27727 } else {
27728 Bytes::new(__input)
27729 };
27730 let mut __struct = Self::default();
27731 __struct.time_boot_ms = buf.get_u32_le()?;
27732 __struct.press_abs = buf.get_f32_le()?;
27733 __struct.press_diff = buf.get_f32_le()?;
27734 __struct.temperature = buf.get_i16_le()?;
27735 __struct.temperature_press_diff = buf.get_i16_le()?;
27736 Ok(__struct)
27737 }
27738 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27739 let mut __tmp = BytesMut::new(bytes);
27740 #[allow(clippy::absurd_extreme_comparisons)]
27741 #[allow(unused_comparisons)]
27742 if __tmp.remaining() < Self::ENCODED_LEN {
27743 panic!(
27744 "buffer is too small (need {} bytes, but got {})",
27745 Self::ENCODED_LEN,
27746 __tmp.remaining(),
27747 )
27748 }
27749 __tmp.put_u32_le(self.time_boot_ms);
27750 __tmp.put_f32_le(self.press_abs);
27751 __tmp.put_f32_le(self.press_diff);
27752 __tmp.put_i16_le(self.temperature);
27753 if matches!(version, MavlinkVersion::V2) {
27754 __tmp.put_i16_le(self.temperature_press_diff);
27755 let len = __tmp.len();
27756 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27757 } else {
27758 __tmp.len()
27759 }
27760 }
27761}
27762#[doc = "Barometer readings for 2nd barometer."]
27763#[doc = ""]
27764#[doc = "ID: 137"]
27765#[derive(Debug, Clone, PartialEq)]
27766#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27767#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27768#[cfg_attr(feature = "ts", derive(TS))]
27769#[cfg_attr(feature = "ts", ts(export))]
27770pub struct SCALED_PRESSURE2_DATA {
27771 #[doc = "Timestamp (time since system boot)."]
27772 pub time_boot_ms: u32,
27773 #[doc = "Absolute pressure"]
27774 pub press_abs: f32,
27775 #[doc = "Differential pressure"]
27776 pub press_diff: f32,
27777 #[doc = "Absolute pressure temperature"]
27778 pub temperature: i16,
27779 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27780 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27781 pub temperature_press_diff: i16,
27782}
27783impl SCALED_PRESSURE2_DATA {
27784 pub const ENCODED_LEN: usize = 16usize;
27785 pub const DEFAULT: Self = Self {
27786 time_boot_ms: 0_u32,
27787 press_abs: 0.0_f32,
27788 press_diff: 0.0_f32,
27789 temperature: 0_i16,
27790 temperature_press_diff: 0_i16,
27791 };
27792 #[cfg(feature = "arbitrary")]
27793 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27794 use arbitrary::{Arbitrary, Unstructured};
27795 let mut buf = [0u8; 1024];
27796 rng.fill_bytes(&mut buf);
27797 let mut unstructured = Unstructured::new(&buf);
27798 Self::arbitrary(&mut unstructured).unwrap_or_default()
27799 }
27800}
27801impl Default for SCALED_PRESSURE2_DATA {
27802 fn default() -> Self {
27803 Self::DEFAULT.clone()
27804 }
27805}
27806impl MessageData for SCALED_PRESSURE2_DATA {
27807 type Message = MavMessage;
27808 const ID: u32 = 137u32;
27809 const NAME: &'static str = "SCALED_PRESSURE2";
27810 const EXTRA_CRC: u8 = 195u8;
27811 const ENCODED_LEN: usize = 16usize;
27812 fn deser(
27813 _version: MavlinkVersion,
27814 __input: &[u8],
27815 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27816 let avail_len = __input.len();
27817 let mut payload_buf = [0; Self::ENCODED_LEN];
27818 let mut buf = if avail_len < Self::ENCODED_LEN {
27819 payload_buf[0..avail_len].copy_from_slice(__input);
27820 Bytes::new(&payload_buf)
27821 } else {
27822 Bytes::new(__input)
27823 };
27824 let mut __struct = Self::default();
27825 __struct.time_boot_ms = buf.get_u32_le()?;
27826 __struct.press_abs = buf.get_f32_le()?;
27827 __struct.press_diff = buf.get_f32_le()?;
27828 __struct.temperature = buf.get_i16_le()?;
27829 __struct.temperature_press_diff = buf.get_i16_le()?;
27830 Ok(__struct)
27831 }
27832 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27833 let mut __tmp = BytesMut::new(bytes);
27834 #[allow(clippy::absurd_extreme_comparisons)]
27835 #[allow(unused_comparisons)]
27836 if __tmp.remaining() < Self::ENCODED_LEN {
27837 panic!(
27838 "buffer is too small (need {} bytes, but got {})",
27839 Self::ENCODED_LEN,
27840 __tmp.remaining(),
27841 )
27842 }
27843 __tmp.put_u32_le(self.time_boot_ms);
27844 __tmp.put_f32_le(self.press_abs);
27845 __tmp.put_f32_le(self.press_diff);
27846 __tmp.put_i16_le(self.temperature);
27847 if matches!(version, MavlinkVersion::V2) {
27848 __tmp.put_i16_le(self.temperature_press_diff);
27849 let len = __tmp.len();
27850 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27851 } else {
27852 __tmp.len()
27853 }
27854 }
27855}
27856#[doc = "Barometer readings for 3rd barometer."]
27857#[doc = ""]
27858#[doc = "ID: 143"]
27859#[derive(Debug, Clone, PartialEq)]
27860#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27861#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27862#[cfg_attr(feature = "ts", derive(TS))]
27863#[cfg_attr(feature = "ts", ts(export))]
27864pub struct SCALED_PRESSURE3_DATA {
27865 #[doc = "Timestamp (time since system boot)."]
27866 pub time_boot_ms: u32,
27867 #[doc = "Absolute pressure"]
27868 pub press_abs: f32,
27869 #[doc = "Differential pressure"]
27870 pub press_diff: f32,
27871 #[doc = "Absolute pressure temperature"]
27872 pub temperature: i16,
27873 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
27874 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27875 pub temperature_press_diff: i16,
27876}
27877impl SCALED_PRESSURE3_DATA {
27878 pub const ENCODED_LEN: usize = 16usize;
27879 pub const DEFAULT: Self = Self {
27880 time_boot_ms: 0_u32,
27881 press_abs: 0.0_f32,
27882 press_diff: 0.0_f32,
27883 temperature: 0_i16,
27884 temperature_press_diff: 0_i16,
27885 };
27886 #[cfg(feature = "arbitrary")]
27887 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27888 use arbitrary::{Arbitrary, Unstructured};
27889 let mut buf = [0u8; 1024];
27890 rng.fill_bytes(&mut buf);
27891 let mut unstructured = Unstructured::new(&buf);
27892 Self::arbitrary(&mut unstructured).unwrap_or_default()
27893 }
27894}
27895impl Default for SCALED_PRESSURE3_DATA {
27896 fn default() -> Self {
27897 Self::DEFAULT.clone()
27898 }
27899}
27900impl MessageData for SCALED_PRESSURE3_DATA {
27901 type Message = MavMessage;
27902 const ID: u32 = 143u32;
27903 const NAME: &'static str = "SCALED_PRESSURE3";
27904 const EXTRA_CRC: u8 = 131u8;
27905 const ENCODED_LEN: usize = 16usize;
27906 fn deser(
27907 _version: MavlinkVersion,
27908 __input: &[u8],
27909 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27910 let avail_len = __input.len();
27911 let mut payload_buf = [0; Self::ENCODED_LEN];
27912 let mut buf = if avail_len < Self::ENCODED_LEN {
27913 payload_buf[0..avail_len].copy_from_slice(__input);
27914 Bytes::new(&payload_buf)
27915 } else {
27916 Bytes::new(__input)
27917 };
27918 let mut __struct = Self::default();
27919 __struct.time_boot_ms = buf.get_u32_le()?;
27920 __struct.press_abs = buf.get_f32_le()?;
27921 __struct.press_diff = buf.get_f32_le()?;
27922 __struct.temperature = buf.get_i16_le()?;
27923 __struct.temperature_press_diff = buf.get_i16_le()?;
27924 Ok(__struct)
27925 }
27926 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27927 let mut __tmp = BytesMut::new(bytes);
27928 #[allow(clippy::absurd_extreme_comparisons)]
27929 #[allow(unused_comparisons)]
27930 if __tmp.remaining() < Self::ENCODED_LEN {
27931 panic!(
27932 "buffer is too small (need {} bytes, but got {})",
27933 Self::ENCODED_LEN,
27934 __tmp.remaining(),
27935 )
27936 }
27937 __tmp.put_u32_le(self.time_boot_ms);
27938 __tmp.put_f32_le(self.press_abs);
27939 __tmp.put_f32_le(self.press_diff);
27940 __tmp.put_i16_le(self.temperature);
27941 if matches!(version, MavlinkVersion::V2) {
27942 __tmp.put_i16_le(self.temperature_press_diff);
27943 let len = __tmp.len();
27944 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27945 } else {
27946 __tmp.len()
27947 }
27948 }
27949}
27950#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
27951#[doc = ""]
27952#[doc = "ID: 126"]
27953#[derive(Debug, Clone, PartialEq)]
27954#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27955#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27956#[cfg_attr(feature = "ts", derive(TS))]
27957#[cfg_attr(feature = "ts", ts(export))]
27958pub struct SERIAL_CONTROL_DATA {
27959 #[doc = "Baudrate of transfer. Zero means no change."]
27960 pub baudrate: u32,
27961 #[doc = "Timeout for reply data"]
27962 pub timeout: u16,
27963 #[doc = "Serial control device type."]
27964 pub device: SerialControlDev,
27965 #[doc = "Bitmap of serial control flags."]
27966 pub flags: SerialControlFlag,
27967 #[doc = "how many bytes in this transfer"]
27968 pub count: u8,
27969 #[doc = "serial data"]
27970 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27971 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
27972 pub data: [u8; 70],
27973 #[doc = "System ID"]
27974 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27975 pub target_system: u8,
27976 #[doc = "Component ID"]
27977 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27978 pub target_component: u8,
27979}
27980impl SERIAL_CONTROL_DATA {
27981 pub const ENCODED_LEN: usize = 81usize;
27982 pub const DEFAULT: Self = Self {
27983 baudrate: 0_u32,
27984 timeout: 0_u16,
27985 device: SerialControlDev::DEFAULT,
27986 flags: SerialControlFlag::DEFAULT,
27987 count: 0_u8,
27988 data: [0_u8; 70usize],
27989 target_system: 0_u8,
27990 target_component: 0_u8,
27991 };
27992 #[cfg(feature = "arbitrary")]
27993 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27994 use arbitrary::{Arbitrary, Unstructured};
27995 let mut buf = [0u8; 1024];
27996 rng.fill_bytes(&mut buf);
27997 let mut unstructured = Unstructured::new(&buf);
27998 Self::arbitrary(&mut unstructured).unwrap_or_default()
27999 }
28000}
28001impl Default for SERIAL_CONTROL_DATA {
28002 fn default() -> Self {
28003 Self::DEFAULT.clone()
28004 }
28005}
28006impl MessageData for SERIAL_CONTROL_DATA {
28007 type Message = MavMessage;
28008 const ID: u32 = 126u32;
28009 const NAME: &'static str = "SERIAL_CONTROL";
28010 const EXTRA_CRC: u8 = 220u8;
28011 const ENCODED_LEN: usize = 81usize;
28012 fn deser(
28013 _version: MavlinkVersion,
28014 __input: &[u8],
28015 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28016 let avail_len = __input.len();
28017 let mut payload_buf = [0; Self::ENCODED_LEN];
28018 let mut buf = if avail_len < Self::ENCODED_LEN {
28019 payload_buf[0..avail_len].copy_from_slice(__input);
28020 Bytes::new(&payload_buf)
28021 } else {
28022 Bytes::new(__input)
28023 };
28024 let mut __struct = Self::default();
28025 __struct.baudrate = buf.get_u32_le()?;
28026 __struct.timeout = buf.get_u16_le()?;
28027 let tmp = buf.get_u8()?;
28028 __struct.device =
28029 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28030 enum_type: "SerialControlDev",
28031 value: tmp as u64,
28032 })?;
28033 let tmp = buf.get_u8()?;
28034 __struct.flags = SerialControlFlag::from_bits(tmp as <SerialControlFlag as Flags>::Bits)
28035 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28036 flag_type: "SerialControlFlag",
28037 value: tmp as u64,
28038 })?;
28039 __struct.count = buf.get_u8()?;
28040 for v in &mut __struct.data {
28041 let val = buf.get_u8()?;
28042 *v = val;
28043 }
28044 __struct.target_system = buf.get_u8()?;
28045 __struct.target_component = buf.get_u8()?;
28046 Ok(__struct)
28047 }
28048 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28049 let mut __tmp = BytesMut::new(bytes);
28050 #[allow(clippy::absurd_extreme_comparisons)]
28051 #[allow(unused_comparisons)]
28052 if __tmp.remaining() < Self::ENCODED_LEN {
28053 panic!(
28054 "buffer is too small (need {} bytes, but got {})",
28055 Self::ENCODED_LEN,
28056 __tmp.remaining(),
28057 )
28058 }
28059 __tmp.put_u32_le(self.baudrate);
28060 __tmp.put_u16_le(self.timeout);
28061 __tmp.put_u8(self.device as u8);
28062 __tmp.put_u8(self.flags.bits() as u8);
28063 __tmp.put_u8(self.count);
28064 for val in &self.data {
28065 __tmp.put_u8(*val);
28066 }
28067 if matches!(version, MavlinkVersion::V2) {
28068 __tmp.put_u8(self.target_system);
28069 __tmp.put_u8(self.target_component);
28070 let len = __tmp.len();
28071 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28072 } else {
28073 __tmp.len()
28074 }
28075 }
28076}
28077#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
28078#[doc = ""]
28079#[doc = "ID: 36"]
28080#[derive(Debug, Clone, PartialEq)]
28081#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28082#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28083#[cfg_attr(feature = "ts", derive(TS))]
28084#[cfg_attr(feature = "ts", ts(export))]
28085pub struct SERVO_OUTPUT_RAW_DATA {
28086 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28087 pub time_usec: u32,
28088 #[doc = "Servo output 1 value"]
28089 pub servo1_raw: u16,
28090 #[doc = "Servo output 2 value"]
28091 pub servo2_raw: u16,
28092 #[doc = "Servo output 3 value"]
28093 pub servo3_raw: u16,
28094 #[doc = "Servo output 4 value"]
28095 pub servo4_raw: u16,
28096 #[doc = "Servo output 5 value"]
28097 pub servo5_raw: u16,
28098 #[doc = "Servo output 6 value"]
28099 pub servo6_raw: u16,
28100 #[doc = "Servo output 7 value"]
28101 pub servo7_raw: u16,
28102 #[doc = "Servo output 8 value"]
28103 pub servo8_raw: u16,
28104 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
28105 pub port: u8,
28106 #[doc = "Servo output 9 value"]
28107 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28108 pub servo9_raw: u16,
28109 #[doc = "Servo output 10 value"]
28110 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28111 pub servo10_raw: u16,
28112 #[doc = "Servo output 11 value"]
28113 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28114 pub servo11_raw: u16,
28115 #[doc = "Servo output 12 value"]
28116 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28117 pub servo12_raw: u16,
28118 #[doc = "Servo output 13 value"]
28119 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28120 pub servo13_raw: u16,
28121 #[doc = "Servo output 14 value"]
28122 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28123 pub servo14_raw: u16,
28124 #[doc = "Servo output 15 value"]
28125 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28126 pub servo15_raw: u16,
28127 #[doc = "Servo output 16 value"]
28128 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28129 pub servo16_raw: u16,
28130}
28131impl SERVO_OUTPUT_RAW_DATA {
28132 pub const ENCODED_LEN: usize = 37usize;
28133 pub const DEFAULT: Self = Self {
28134 time_usec: 0_u32,
28135 servo1_raw: 0_u16,
28136 servo2_raw: 0_u16,
28137 servo3_raw: 0_u16,
28138 servo4_raw: 0_u16,
28139 servo5_raw: 0_u16,
28140 servo6_raw: 0_u16,
28141 servo7_raw: 0_u16,
28142 servo8_raw: 0_u16,
28143 port: 0_u8,
28144 servo9_raw: 0_u16,
28145 servo10_raw: 0_u16,
28146 servo11_raw: 0_u16,
28147 servo12_raw: 0_u16,
28148 servo13_raw: 0_u16,
28149 servo14_raw: 0_u16,
28150 servo15_raw: 0_u16,
28151 servo16_raw: 0_u16,
28152 };
28153 #[cfg(feature = "arbitrary")]
28154 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28155 use arbitrary::{Arbitrary, Unstructured};
28156 let mut buf = [0u8; 1024];
28157 rng.fill_bytes(&mut buf);
28158 let mut unstructured = Unstructured::new(&buf);
28159 Self::arbitrary(&mut unstructured).unwrap_or_default()
28160 }
28161}
28162impl Default for SERVO_OUTPUT_RAW_DATA {
28163 fn default() -> Self {
28164 Self::DEFAULT.clone()
28165 }
28166}
28167impl MessageData for SERVO_OUTPUT_RAW_DATA {
28168 type Message = MavMessage;
28169 const ID: u32 = 36u32;
28170 const NAME: &'static str = "SERVO_OUTPUT_RAW";
28171 const EXTRA_CRC: u8 = 222u8;
28172 const ENCODED_LEN: usize = 37usize;
28173 fn deser(
28174 _version: MavlinkVersion,
28175 __input: &[u8],
28176 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28177 let avail_len = __input.len();
28178 let mut payload_buf = [0; Self::ENCODED_LEN];
28179 let mut buf = if avail_len < Self::ENCODED_LEN {
28180 payload_buf[0..avail_len].copy_from_slice(__input);
28181 Bytes::new(&payload_buf)
28182 } else {
28183 Bytes::new(__input)
28184 };
28185 let mut __struct = Self::default();
28186 __struct.time_usec = buf.get_u32_le()?;
28187 __struct.servo1_raw = buf.get_u16_le()?;
28188 __struct.servo2_raw = buf.get_u16_le()?;
28189 __struct.servo3_raw = buf.get_u16_le()?;
28190 __struct.servo4_raw = buf.get_u16_le()?;
28191 __struct.servo5_raw = buf.get_u16_le()?;
28192 __struct.servo6_raw = buf.get_u16_le()?;
28193 __struct.servo7_raw = buf.get_u16_le()?;
28194 __struct.servo8_raw = buf.get_u16_le()?;
28195 __struct.port = buf.get_u8()?;
28196 __struct.servo9_raw = buf.get_u16_le()?;
28197 __struct.servo10_raw = buf.get_u16_le()?;
28198 __struct.servo11_raw = buf.get_u16_le()?;
28199 __struct.servo12_raw = buf.get_u16_le()?;
28200 __struct.servo13_raw = buf.get_u16_le()?;
28201 __struct.servo14_raw = buf.get_u16_le()?;
28202 __struct.servo15_raw = buf.get_u16_le()?;
28203 __struct.servo16_raw = buf.get_u16_le()?;
28204 Ok(__struct)
28205 }
28206 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28207 let mut __tmp = BytesMut::new(bytes);
28208 #[allow(clippy::absurd_extreme_comparisons)]
28209 #[allow(unused_comparisons)]
28210 if __tmp.remaining() < Self::ENCODED_LEN {
28211 panic!(
28212 "buffer is too small (need {} bytes, but got {})",
28213 Self::ENCODED_LEN,
28214 __tmp.remaining(),
28215 )
28216 }
28217 __tmp.put_u32_le(self.time_usec);
28218 __tmp.put_u16_le(self.servo1_raw);
28219 __tmp.put_u16_le(self.servo2_raw);
28220 __tmp.put_u16_le(self.servo3_raw);
28221 __tmp.put_u16_le(self.servo4_raw);
28222 __tmp.put_u16_le(self.servo5_raw);
28223 __tmp.put_u16_le(self.servo6_raw);
28224 __tmp.put_u16_le(self.servo7_raw);
28225 __tmp.put_u16_le(self.servo8_raw);
28226 __tmp.put_u8(self.port);
28227 if matches!(version, MavlinkVersion::V2) {
28228 __tmp.put_u16_le(self.servo9_raw);
28229 __tmp.put_u16_le(self.servo10_raw);
28230 __tmp.put_u16_le(self.servo11_raw);
28231 __tmp.put_u16_le(self.servo12_raw);
28232 __tmp.put_u16_le(self.servo13_raw);
28233 __tmp.put_u16_le(self.servo14_raw);
28234 __tmp.put_u16_le(self.servo15_raw);
28235 __tmp.put_u16_le(self.servo16_raw);
28236 let len = __tmp.len();
28237 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28238 } else {
28239 __tmp.len()
28240 }
28241 }
28242}
28243#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
28244#[doc = ""]
28245#[doc = "ID: 256"]
28246#[derive(Debug, Clone, PartialEq)]
28247#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28248#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28249#[cfg_attr(feature = "ts", derive(TS))]
28250#[cfg_attr(feature = "ts", ts(export))]
28251pub struct SETUP_SIGNING_DATA {
28252 #[doc = "initial timestamp"]
28253 pub initial_timestamp: u64,
28254 #[doc = "system id of the target"]
28255 pub target_system: u8,
28256 #[doc = "component ID of the target"]
28257 pub target_component: u8,
28258 #[doc = "signing key"]
28259 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28260 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28261 pub secret_key: [u8; 32],
28262}
28263impl SETUP_SIGNING_DATA {
28264 pub const ENCODED_LEN: usize = 42usize;
28265 pub const DEFAULT: Self = Self {
28266 initial_timestamp: 0_u64,
28267 target_system: 0_u8,
28268 target_component: 0_u8,
28269 secret_key: [0_u8; 32usize],
28270 };
28271 #[cfg(feature = "arbitrary")]
28272 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28273 use arbitrary::{Arbitrary, Unstructured};
28274 let mut buf = [0u8; 1024];
28275 rng.fill_bytes(&mut buf);
28276 let mut unstructured = Unstructured::new(&buf);
28277 Self::arbitrary(&mut unstructured).unwrap_or_default()
28278 }
28279}
28280impl Default for SETUP_SIGNING_DATA {
28281 fn default() -> Self {
28282 Self::DEFAULT.clone()
28283 }
28284}
28285impl MessageData for SETUP_SIGNING_DATA {
28286 type Message = MavMessage;
28287 const ID: u32 = 256u32;
28288 const NAME: &'static str = "SETUP_SIGNING";
28289 const EXTRA_CRC: u8 = 71u8;
28290 const ENCODED_LEN: usize = 42usize;
28291 fn deser(
28292 _version: MavlinkVersion,
28293 __input: &[u8],
28294 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28295 let avail_len = __input.len();
28296 let mut payload_buf = [0; Self::ENCODED_LEN];
28297 let mut buf = if avail_len < Self::ENCODED_LEN {
28298 payload_buf[0..avail_len].copy_from_slice(__input);
28299 Bytes::new(&payload_buf)
28300 } else {
28301 Bytes::new(__input)
28302 };
28303 let mut __struct = Self::default();
28304 __struct.initial_timestamp = buf.get_u64_le()?;
28305 __struct.target_system = buf.get_u8()?;
28306 __struct.target_component = buf.get_u8()?;
28307 for v in &mut __struct.secret_key {
28308 let val = buf.get_u8()?;
28309 *v = val;
28310 }
28311 Ok(__struct)
28312 }
28313 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28314 let mut __tmp = BytesMut::new(bytes);
28315 #[allow(clippy::absurd_extreme_comparisons)]
28316 #[allow(unused_comparisons)]
28317 if __tmp.remaining() < Self::ENCODED_LEN {
28318 panic!(
28319 "buffer is too small (need {} bytes, but got {})",
28320 Self::ENCODED_LEN,
28321 __tmp.remaining(),
28322 )
28323 }
28324 __tmp.put_u64_le(self.initial_timestamp);
28325 __tmp.put_u8(self.target_system);
28326 __tmp.put_u8(self.target_component);
28327 for val in &self.secret_key {
28328 __tmp.put_u8(*val);
28329 }
28330 if matches!(version, MavlinkVersion::V2) {
28331 let len = __tmp.len();
28332 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28333 } else {
28334 __tmp.len()
28335 }
28336 }
28337}
28338#[doc = "Set the vehicle attitude and body angular rates."]
28339#[doc = ""]
28340#[doc = "ID: 139"]
28341#[derive(Debug, Clone, PartialEq)]
28342#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28343#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28344#[cfg_attr(feature = "ts", derive(TS))]
28345#[cfg_attr(feature = "ts", ts(export))]
28346pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
28347 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28348 pub time_usec: u64,
28349 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
28350 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28351 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28352 pub controls: [f32; 8],
28353 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
28354 pub group_mlx: u8,
28355 #[doc = "System ID"]
28356 pub target_system: u8,
28357 #[doc = "Component ID"]
28358 pub target_component: u8,
28359}
28360impl SET_ACTUATOR_CONTROL_TARGET_DATA {
28361 pub const ENCODED_LEN: usize = 43usize;
28362 pub const DEFAULT: Self = Self {
28363 time_usec: 0_u64,
28364 controls: [0.0_f32; 8usize],
28365 group_mlx: 0_u8,
28366 target_system: 0_u8,
28367 target_component: 0_u8,
28368 };
28369 #[cfg(feature = "arbitrary")]
28370 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28371 use arbitrary::{Arbitrary, Unstructured};
28372 let mut buf = [0u8; 1024];
28373 rng.fill_bytes(&mut buf);
28374 let mut unstructured = Unstructured::new(&buf);
28375 Self::arbitrary(&mut unstructured).unwrap_or_default()
28376 }
28377}
28378impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
28379 fn default() -> Self {
28380 Self::DEFAULT.clone()
28381 }
28382}
28383impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
28384 type Message = MavMessage;
28385 const ID: u32 = 139u32;
28386 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
28387 const EXTRA_CRC: u8 = 168u8;
28388 const ENCODED_LEN: usize = 43usize;
28389 fn deser(
28390 _version: MavlinkVersion,
28391 __input: &[u8],
28392 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28393 let avail_len = __input.len();
28394 let mut payload_buf = [0; Self::ENCODED_LEN];
28395 let mut buf = if avail_len < Self::ENCODED_LEN {
28396 payload_buf[0..avail_len].copy_from_slice(__input);
28397 Bytes::new(&payload_buf)
28398 } else {
28399 Bytes::new(__input)
28400 };
28401 let mut __struct = Self::default();
28402 __struct.time_usec = buf.get_u64_le()?;
28403 for v in &mut __struct.controls {
28404 let val = buf.get_f32_le()?;
28405 *v = val;
28406 }
28407 __struct.group_mlx = buf.get_u8()?;
28408 __struct.target_system = buf.get_u8()?;
28409 __struct.target_component = buf.get_u8()?;
28410 Ok(__struct)
28411 }
28412 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28413 let mut __tmp = BytesMut::new(bytes);
28414 #[allow(clippy::absurd_extreme_comparisons)]
28415 #[allow(unused_comparisons)]
28416 if __tmp.remaining() < Self::ENCODED_LEN {
28417 panic!(
28418 "buffer is too small (need {} bytes, but got {})",
28419 Self::ENCODED_LEN,
28420 __tmp.remaining(),
28421 )
28422 }
28423 __tmp.put_u64_le(self.time_usec);
28424 for val in &self.controls {
28425 __tmp.put_f32_le(*val);
28426 }
28427 __tmp.put_u8(self.group_mlx);
28428 __tmp.put_u8(self.target_system);
28429 __tmp.put_u8(self.target_component);
28430 if matches!(version, MavlinkVersion::V2) {
28431 let len = __tmp.len();
28432 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28433 } else {
28434 __tmp.len()
28435 }
28436 }
28437}
28438#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
28439#[doc = ""]
28440#[doc = "ID: 82"]
28441#[derive(Debug, Clone, PartialEq)]
28442#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28443#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28444#[cfg_attr(feature = "ts", derive(TS))]
28445#[cfg_attr(feature = "ts", ts(export))]
28446pub struct SET_ATTITUDE_TARGET_DATA {
28447 #[doc = "Timestamp (time since system boot)."]
28448 pub time_boot_ms: u32,
28449 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
28450 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28451 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28452 pub q: [f32; 4],
28453 #[doc = "Body roll rate"]
28454 pub body_roll_rate: f32,
28455 #[doc = "Body pitch rate"]
28456 pub body_pitch_rate: f32,
28457 #[doc = "Body yaw rate"]
28458 pub body_yaw_rate: f32,
28459 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
28460 pub thrust: f32,
28461 #[doc = "System ID"]
28462 pub target_system: u8,
28463 #[doc = "Component ID"]
28464 pub target_component: u8,
28465 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28466 pub type_mask: AttitudeTargetTypemask,
28467 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
28468 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28469 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28470 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28471 pub thrust_body: [f32; 3],
28472}
28473impl SET_ATTITUDE_TARGET_DATA {
28474 pub const ENCODED_LEN: usize = 51usize;
28475 pub const DEFAULT: Self = Self {
28476 time_boot_ms: 0_u32,
28477 q: [0.0_f32; 4usize],
28478 body_roll_rate: 0.0_f32,
28479 body_pitch_rate: 0.0_f32,
28480 body_yaw_rate: 0.0_f32,
28481 thrust: 0.0_f32,
28482 target_system: 0_u8,
28483 target_component: 0_u8,
28484 type_mask: AttitudeTargetTypemask::DEFAULT,
28485 thrust_body: [0.0_f32; 3usize],
28486 };
28487 #[cfg(feature = "arbitrary")]
28488 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28489 use arbitrary::{Arbitrary, Unstructured};
28490 let mut buf = [0u8; 1024];
28491 rng.fill_bytes(&mut buf);
28492 let mut unstructured = Unstructured::new(&buf);
28493 Self::arbitrary(&mut unstructured).unwrap_or_default()
28494 }
28495}
28496impl Default for SET_ATTITUDE_TARGET_DATA {
28497 fn default() -> Self {
28498 Self::DEFAULT.clone()
28499 }
28500}
28501impl MessageData for SET_ATTITUDE_TARGET_DATA {
28502 type Message = MavMessage;
28503 const ID: u32 = 82u32;
28504 const NAME: &'static str = "SET_ATTITUDE_TARGET";
28505 const EXTRA_CRC: u8 = 49u8;
28506 const ENCODED_LEN: usize = 51usize;
28507 fn deser(
28508 _version: MavlinkVersion,
28509 __input: &[u8],
28510 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28511 let avail_len = __input.len();
28512 let mut payload_buf = [0; Self::ENCODED_LEN];
28513 let mut buf = if avail_len < Self::ENCODED_LEN {
28514 payload_buf[0..avail_len].copy_from_slice(__input);
28515 Bytes::new(&payload_buf)
28516 } else {
28517 Bytes::new(__input)
28518 };
28519 let mut __struct = Self::default();
28520 __struct.time_boot_ms = buf.get_u32_le()?;
28521 for v in &mut __struct.q {
28522 let val = buf.get_f32_le()?;
28523 *v = val;
28524 }
28525 __struct.body_roll_rate = buf.get_f32_le()?;
28526 __struct.body_pitch_rate = buf.get_f32_le()?;
28527 __struct.body_yaw_rate = buf.get_f32_le()?;
28528 __struct.thrust = buf.get_f32_le()?;
28529 __struct.target_system = buf.get_u8()?;
28530 __struct.target_component = buf.get_u8()?;
28531 let tmp = buf.get_u8()?;
28532 __struct.type_mask =
28533 AttitudeTargetTypemask::from_bits(tmp as <AttitudeTargetTypemask as Flags>::Bits)
28534 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28535 flag_type: "AttitudeTargetTypemask",
28536 value: tmp as u64,
28537 })?;
28538 for v in &mut __struct.thrust_body {
28539 let val = buf.get_f32_le()?;
28540 *v = val;
28541 }
28542 Ok(__struct)
28543 }
28544 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28545 let mut __tmp = BytesMut::new(bytes);
28546 #[allow(clippy::absurd_extreme_comparisons)]
28547 #[allow(unused_comparisons)]
28548 if __tmp.remaining() < Self::ENCODED_LEN {
28549 panic!(
28550 "buffer is too small (need {} bytes, but got {})",
28551 Self::ENCODED_LEN,
28552 __tmp.remaining(),
28553 )
28554 }
28555 __tmp.put_u32_le(self.time_boot_ms);
28556 for val in &self.q {
28557 __tmp.put_f32_le(*val);
28558 }
28559 __tmp.put_f32_le(self.body_roll_rate);
28560 __tmp.put_f32_le(self.body_pitch_rate);
28561 __tmp.put_f32_le(self.body_yaw_rate);
28562 __tmp.put_f32_le(self.thrust);
28563 __tmp.put_u8(self.target_system);
28564 __tmp.put_u8(self.target_component);
28565 __tmp.put_u8(self.type_mask.bits() as u8);
28566 if matches!(version, MavlinkVersion::V2) {
28567 for val in &self.thrust_body {
28568 __tmp.put_f32_le(*val);
28569 }
28570 let len = __tmp.len();
28571 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28572 } else {
28573 __tmp.len()
28574 }
28575 }
28576}
28577#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
28578#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
28579#[doc = ""]
28580#[doc = "ID: 48"]
28581#[derive(Debug, Clone, PartialEq)]
28582#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28583#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28584#[cfg_attr(feature = "ts", derive(TS))]
28585#[cfg_attr(feature = "ts", ts(export))]
28586pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
28587 #[doc = "Latitude (WGS84)"]
28588 pub latitude: i32,
28589 #[doc = "Longitude (WGS84)"]
28590 pub longitude: i32,
28591 #[doc = "Altitude (MSL). Positive for up."]
28592 pub altitude: i32,
28593 #[doc = "System ID"]
28594 pub target_system: u8,
28595 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28596 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28597 pub time_usec: u64,
28598}
28599impl SET_GPS_GLOBAL_ORIGIN_DATA {
28600 pub const ENCODED_LEN: usize = 21usize;
28601 pub const DEFAULT: Self = Self {
28602 latitude: 0_i32,
28603 longitude: 0_i32,
28604 altitude: 0_i32,
28605 target_system: 0_u8,
28606 time_usec: 0_u64,
28607 };
28608 #[cfg(feature = "arbitrary")]
28609 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28610 use arbitrary::{Arbitrary, Unstructured};
28611 let mut buf = [0u8; 1024];
28612 rng.fill_bytes(&mut buf);
28613 let mut unstructured = Unstructured::new(&buf);
28614 Self::arbitrary(&mut unstructured).unwrap_or_default()
28615 }
28616}
28617impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
28618 fn default() -> Self {
28619 Self::DEFAULT.clone()
28620 }
28621}
28622impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
28623 type Message = MavMessage;
28624 const ID: u32 = 48u32;
28625 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
28626 const EXTRA_CRC: u8 = 41u8;
28627 const ENCODED_LEN: usize = 21usize;
28628 fn deser(
28629 _version: MavlinkVersion,
28630 __input: &[u8],
28631 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28632 let avail_len = __input.len();
28633 let mut payload_buf = [0; Self::ENCODED_LEN];
28634 let mut buf = if avail_len < Self::ENCODED_LEN {
28635 payload_buf[0..avail_len].copy_from_slice(__input);
28636 Bytes::new(&payload_buf)
28637 } else {
28638 Bytes::new(__input)
28639 };
28640 let mut __struct = Self::default();
28641 __struct.latitude = buf.get_i32_le()?;
28642 __struct.longitude = buf.get_i32_le()?;
28643 __struct.altitude = buf.get_i32_le()?;
28644 __struct.target_system = buf.get_u8()?;
28645 __struct.time_usec = buf.get_u64_le()?;
28646 Ok(__struct)
28647 }
28648 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28649 let mut __tmp = BytesMut::new(bytes);
28650 #[allow(clippy::absurd_extreme_comparisons)]
28651 #[allow(unused_comparisons)]
28652 if __tmp.remaining() < Self::ENCODED_LEN {
28653 panic!(
28654 "buffer is too small (need {} bytes, but got {})",
28655 Self::ENCODED_LEN,
28656 __tmp.remaining(),
28657 )
28658 }
28659 __tmp.put_i32_le(self.latitude);
28660 __tmp.put_i32_le(self.longitude);
28661 __tmp.put_i32_le(self.altitude);
28662 __tmp.put_u8(self.target_system);
28663 if matches!(version, MavlinkVersion::V2) {
28664 __tmp.put_u64_le(self.time_usec);
28665 let len = __tmp.len();
28666 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28667 } else {
28668 __tmp.len()
28669 }
28670 }
28671}
28672#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
28673#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
28674#[doc = ""]
28675#[doc = "ID: 243"]
28676#[derive(Debug, Clone, PartialEq)]
28677#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28678#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28679#[cfg_attr(feature = "ts", derive(TS))]
28680#[cfg_attr(feature = "ts", ts(export))]
28681pub struct SET_HOME_POSITION_DATA {
28682 #[doc = "Latitude (WGS84)"]
28683 pub latitude: i32,
28684 #[doc = "Longitude (WGS84)"]
28685 pub longitude: i32,
28686 #[doc = "Altitude (MSL). Positive for up."]
28687 pub altitude: i32,
28688 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
28689 pub x: f32,
28690 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
28691 pub y: f32,
28692 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
28693 pub z: f32,
28694 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
28695 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28696 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
28697 pub q: [f32; 4],
28698 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28699 pub approach_x: f32,
28700 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28701 pub approach_y: f32,
28702 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
28703 pub approach_z: f32,
28704 #[doc = "System ID."]
28705 pub target_system: u8,
28706 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28707 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28708 pub time_usec: u64,
28709}
28710impl SET_HOME_POSITION_DATA {
28711 pub const ENCODED_LEN: usize = 61usize;
28712 pub const DEFAULT: Self = Self {
28713 latitude: 0_i32,
28714 longitude: 0_i32,
28715 altitude: 0_i32,
28716 x: 0.0_f32,
28717 y: 0.0_f32,
28718 z: 0.0_f32,
28719 q: [0.0_f32; 4usize],
28720 approach_x: 0.0_f32,
28721 approach_y: 0.0_f32,
28722 approach_z: 0.0_f32,
28723 target_system: 0_u8,
28724 time_usec: 0_u64,
28725 };
28726 #[cfg(feature = "arbitrary")]
28727 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28728 use arbitrary::{Arbitrary, Unstructured};
28729 let mut buf = [0u8; 1024];
28730 rng.fill_bytes(&mut buf);
28731 let mut unstructured = Unstructured::new(&buf);
28732 Self::arbitrary(&mut unstructured).unwrap_or_default()
28733 }
28734}
28735impl Default for SET_HOME_POSITION_DATA {
28736 fn default() -> Self {
28737 Self::DEFAULT.clone()
28738 }
28739}
28740impl MessageData for SET_HOME_POSITION_DATA {
28741 type Message = MavMessage;
28742 const ID: u32 = 243u32;
28743 const NAME: &'static str = "SET_HOME_POSITION";
28744 const EXTRA_CRC: u8 = 85u8;
28745 const ENCODED_LEN: usize = 61usize;
28746 fn deser(
28747 _version: MavlinkVersion,
28748 __input: &[u8],
28749 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28750 let avail_len = __input.len();
28751 let mut payload_buf = [0; Self::ENCODED_LEN];
28752 let mut buf = if avail_len < Self::ENCODED_LEN {
28753 payload_buf[0..avail_len].copy_from_slice(__input);
28754 Bytes::new(&payload_buf)
28755 } else {
28756 Bytes::new(__input)
28757 };
28758 let mut __struct = Self::default();
28759 __struct.latitude = buf.get_i32_le()?;
28760 __struct.longitude = buf.get_i32_le()?;
28761 __struct.altitude = buf.get_i32_le()?;
28762 __struct.x = buf.get_f32_le()?;
28763 __struct.y = buf.get_f32_le()?;
28764 __struct.z = buf.get_f32_le()?;
28765 for v in &mut __struct.q {
28766 let val = buf.get_f32_le()?;
28767 *v = val;
28768 }
28769 __struct.approach_x = buf.get_f32_le()?;
28770 __struct.approach_y = buf.get_f32_le()?;
28771 __struct.approach_z = buf.get_f32_le()?;
28772 __struct.target_system = buf.get_u8()?;
28773 __struct.time_usec = buf.get_u64_le()?;
28774 Ok(__struct)
28775 }
28776 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28777 let mut __tmp = BytesMut::new(bytes);
28778 #[allow(clippy::absurd_extreme_comparisons)]
28779 #[allow(unused_comparisons)]
28780 if __tmp.remaining() < Self::ENCODED_LEN {
28781 panic!(
28782 "buffer is too small (need {} bytes, but got {})",
28783 Self::ENCODED_LEN,
28784 __tmp.remaining(),
28785 )
28786 }
28787 __tmp.put_i32_le(self.latitude);
28788 __tmp.put_i32_le(self.longitude);
28789 __tmp.put_i32_le(self.altitude);
28790 __tmp.put_f32_le(self.x);
28791 __tmp.put_f32_le(self.y);
28792 __tmp.put_f32_le(self.z);
28793 for val in &self.q {
28794 __tmp.put_f32_le(*val);
28795 }
28796 __tmp.put_f32_le(self.approach_x);
28797 __tmp.put_f32_le(self.approach_y);
28798 __tmp.put_f32_le(self.approach_z);
28799 __tmp.put_u8(self.target_system);
28800 if matches!(version, MavlinkVersion::V2) {
28801 __tmp.put_u64_le(self.time_usec);
28802 let len = __tmp.len();
28803 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28804 } else {
28805 __tmp.len()
28806 }
28807 }
28808}
28809#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
28810#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
28811#[doc = ""]
28812#[doc = "ID: 11"]
28813#[derive(Debug, Clone, PartialEq)]
28814#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28815#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28816#[cfg_attr(feature = "ts", derive(TS))]
28817#[cfg_attr(feature = "ts", ts(export))]
28818pub struct SET_MODE_DATA {
28819 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
28820 pub custom_mode: u32,
28821 #[doc = "The system setting the mode"]
28822 pub target_system: u8,
28823 #[doc = "The new base mode."]
28824 pub base_mode: MavMode,
28825}
28826impl SET_MODE_DATA {
28827 pub const ENCODED_LEN: usize = 6usize;
28828 pub const DEFAULT: Self = Self {
28829 custom_mode: 0_u32,
28830 target_system: 0_u8,
28831 base_mode: MavMode::DEFAULT,
28832 };
28833 #[cfg(feature = "arbitrary")]
28834 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28835 use arbitrary::{Arbitrary, Unstructured};
28836 let mut buf = [0u8; 1024];
28837 rng.fill_bytes(&mut buf);
28838 let mut unstructured = Unstructured::new(&buf);
28839 Self::arbitrary(&mut unstructured).unwrap_or_default()
28840 }
28841}
28842impl Default for SET_MODE_DATA {
28843 fn default() -> Self {
28844 Self::DEFAULT.clone()
28845 }
28846}
28847impl MessageData for SET_MODE_DATA {
28848 type Message = MavMessage;
28849 const ID: u32 = 11u32;
28850 const NAME: &'static str = "SET_MODE";
28851 const EXTRA_CRC: u8 = 89u8;
28852 const ENCODED_LEN: usize = 6usize;
28853 fn deser(
28854 _version: MavlinkVersion,
28855 __input: &[u8],
28856 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28857 let avail_len = __input.len();
28858 let mut payload_buf = [0; Self::ENCODED_LEN];
28859 let mut buf = if avail_len < Self::ENCODED_LEN {
28860 payload_buf[0..avail_len].copy_from_slice(__input);
28861 Bytes::new(&payload_buf)
28862 } else {
28863 Bytes::new(__input)
28864 };
28865 let mut __struct = Self::default();
28866 __struct.custom_mode = buf.get_u32_le()?;
28867 __struct.target_system = buf.get_u8()?;
28868 let tmp = buf.get_u8()?;
28869 __struct.base_mode =
28870 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28871 enum_type: "MavMode",
28872 value: tmp as u64,
28873 })?;
28874 Ok(__struct)
28875 }
28876 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28877 let mut __tmp = BytesMut::new(bytes);
28878 #[allow(clippy::absurd_extreme_comparisons)]
28879 #[allow(unused_comparisons)]
28880 if __tmp.remaining() < Self::ENCODED_LEN {
28881 panic!(
28882 "buffer is too small (need {} bytes, but got {})",
28883 Self::ENCODED_LEN,
28884 __tmp.remaining(),
28885 )
28886 }
28887 __tmp.put_u32_le(self.custom_mode);
28888 __tmp.put_u8(self.target_system);
28889 __tmp.put_u8(self.base_mode as u8);
28890 if matches!(version, MavlinkVersion::V2) {
28891 let len = __tmp.len();
28892 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28893 } else {
28894 __tmp.len()
28895 }
28896 }
28897}
28898#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
28899#[doc = ""]
28900#[doc = "ID: 86"]
28901#[derive(Debug, Clone, PartialEq)]
28902#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28903#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28904#[cfg_attr(feature = "ts", derive(TS))]
28905#[cfg_attr(feature = "ts", ts(export))]
28906pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
28907 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
28908 pub time_boot_ms: u32,
28909 #[doc = "Latitude in WGS84 frame"]
28910 pub lat_int: i32,
28911 #[doc = "Longitude in WGS84 frame"]
28912 pub lon_int: i32,
28913 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
28914 pub alt: f32,
28915 #[doc = "X velocity in NED frame"]
28916 pub vx: f32,
28917 #[doc = "Y velocity in NED frame"]
28918 pub vy: f32,
28919 #[doc = "Z velocity in NED frame"]
28920 pub vz: f32,
28921 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28922 pub afx: f32,
28923 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28924 pub afy: f32,
28925 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
28926 pub afz: f32,
28927 #[doc = "yaw setpoint"]
28928 pub yaw: f32,
28929 #[doc = "yaw rate setpoint"]
28930 pub yaw_rate: f32,
28931 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
28932 pub type_mask: PositionTargetTypemask,
28933 #[doc = "System ID"]
28934 pub target_system: u8,
28935 #[doc = "Component ID"]
28936 pub target_component: u8,
28937 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
28938 pub coordinate_frame: MavFrame,
28939}
28940impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
28941 pub const ENCODED_LEN: usize = 53usize;
28942 pub const DEFAULT: Self = Self {
28943 time_boot_ms: 0_u32,
28944 lat_int: 0_i32,
28945 lon_int: 0_i32,
28946 alt: 0.0_f32,
28947 vx: 0.0_f32,
28948 vy: 0.0_f32,
28949 vz: 0.0_f32,
28950 afx: 0.0_f32,
28951 afy: 0.0_f32,
28952 afz: 0.0_f32,
28953 yaw: 0.0_f32,
28954 yaw_rate: 0.0_f32,
28955 type_mask: PositionTargetTypemask::DEFAULT,
28956 target_system: 0_u8,
28957 target_component: 0_u8,
28958 coordinate_frame: MavFrame::DEFAULT,
28959 };
28960 #[cfg(feature = "arbitrary")]
28961 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28962 use arbitrary::{Arbitrary, Unstructured};
28963 let mut buf = [0u8; 1024];
28964 rng.fill_bytes(&mut buf);
28965 let mut unstructured = Unstructured::new(&buf);
28966 Self::arbitrary(&mut unstructured).unwrap_or_default()
28967 }
28968}
28969impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28970 fn default() -> Self {
28971 Self::DEFAULT.clone()
28972 }
28973}
28974impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
28975 type Message = MavMessage;
28976 const ID: u32 = 86u32;
28977 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
28978 const EXTRA_CRC: u8 = 5u8;
28979 const ENCODED_LEN: usize = 53usize;
28980 fn deser(
28981 _version: MavlinkVersion,
28982 __input: &[u8],
28983 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28984 let avail_len = __input.len();
28985 let mut payload_buf = [0; Self::ENCODED_LEN];
28986 let mut buf = if avail_len < Self::ENCODED_LEN {
28987 payload_buf[0..avail_len].copy_from_slice(__input);
28988 Bytes::new(&payload_buf)
28989 } else {
28990 Bytes::new(__input)
28991 };
28992 let mut __struct = Self::default();
28993 __struct.time_boot_ms = buf.get_u32_le()?;
28994 __struct.lat_int = buf.get_i32_le()?;
28995 __struct.lon_int = buf.get_i32_le()?;
28996 __struct.alt = buf.get_f32_le()?;
28997 __struct.vx = buf.get_f32_le()?;
28998 __struct.vy = buf.get_f32_le()?;
28999 __struct.vz = buf.get_f32_le()?;
29000 __struct.afx = buf.get_f32_le()?;
29001 __struct.afy = buf.get_f32_le()?;
29002 __struct.afz = buf.get_f32_le()?;
29003 __struct.yaw = buf.get_f32_le()?;
29004 __struct.yaw_rate = buf.get_f32_le()?;
29005 let tmp = buf.get_u16_le()?;
29006 __struct.type_mask =
29007 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
29008 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29009 flag_type: "PositionTargetTypemask",
29010 value: tmp as u64,
29011 })?;
29012 __struct.target_system = buf.get_u8()?;
29013 __struct.target_component = buf.get_u8()?;
29014 let tmp = buf.get_u8()?;
29015 __struct.coordinate_frame =
29016 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29017 enum_type: "MavFrame",
29018 value: tmp as u64,
29019 })?;
29020 Ok(__struct)
29021 }
29022 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29023 let mut __tmp = BytesMut::new(bytes);
29024 #[allow(clippy::absurd_extreme_comparisons)]
29025 #[allow(unused_comparisons)]
29026 if __tmp.remaining() < Self::ENCODED_LEN {
29027 panic!(
29028 "buffer is too small (need {} bytes, but got {})",
29029 Self::ENCODED_LEN,
29030 __tmp.remaining(),
29031 )
29032 }
29033 __tmp.put_u32_le(self.time_boot_ms);
29034 __tmp.put_i32_le(self.lat_int);
29035 __tmp.put_i32_le(self.lon_int);
29036 __tmp.put_f32_le(self.alt);
29037 __tmp.put_f32_le(self.vx);
29038 __tmp.put_f32_le(self.vy);
29039 __tmp.put_f32_le(self.vz);
29040 __tmp.put_f32_le(self.afx);
29041 __tmp.put_f32_le(self.afy);
29042 __tmp.put_f32_le(self.afz);
29043 __tmp.put_f32_le(self.yaw);
29044 __tmp.put_f32_le(self.yaw_rate);
29045 __tmp.put_u16_le(self.type_mask.bits() as u16);
29046 __tmp.put_u8(self.target_system);
29047 __tmp.put_u8(self.target_component);
29048 __tmp.put_u8(self.coordinate_frame as u8);
29049 if matches!(version, MavlinkVersion::V2) {
29050 let len = __tmp.len();
29051 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29052 } else {
29053 __tmp.len()
29054 }
29055 }
29056}
29057#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
29058#[doc = ""]
29059#[doc = "ID: 84"]
29060#[derive(Debug, Clone, PartialEq)]
29061#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29062#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29063#[cfg_attr(feature = "ts", derive(TS))]
29064#[cfg_attr(feature = "ts", ts(export))]
29065pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
29066 #[doc = "Timestamp (time since system boot)."]
29067 pub time_boot_ms: u32,
29068 #[doc = "X Position in NED frame"]
29069 pub x: f32,
29070 #[doc = "Y Position in NED frame"]
29071 pub y: f32,
29072 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
29073 pub z: f32,
29074 #[doc = "X velocity in NED frame"]
29075 pub vx: f32,
29076 #[doc = "Y velocity in NED frame"]
29077 pub vy: f32,
29078 #[doc = "Z velocity in NED frame"]
29079 pub vz: f32,
29080 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
29081 pub afx: f32,
29082 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
29083 pub afy: f32,
29084 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
29085 pub afz: f32,
29086 #[doc = "yaw setpoint"]
29087 pub yaw: f32,
29088 #[doc = "yaw rate setpoint"]
29089 pub yaw_rate: f32,
29090 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
29091 pub type_mask: PositionTargetTypemask,
29092 #[doc = "System ID"]
29093 pub target_system: u8,
29094 #[doc = "Component ID"]
29095 pub target_component: u8,
29096 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
29097 pub coordinate_frame: MavFrame,
29098}
29099impl SET_POSITION_TARGET_LOCAL_NED_DATA {
29100 pub const ENCODED_LEN: usize = 53usize;
29101 pub const DEFAULT: Self = Self {
29102 time_boot_ms: 0_u32,
29103 x: 0.0_f32,
29104 y: 0.0_f32,
29105 z: 0.0_f32,
29106 vx: 0.0_f32,
29107 vy: 0.0_f32,
29108 vz: 0.0_f32,
29109 afx: 0.0_f32,
29110 afy: 0.0_f32,
29111 afz: 0.0_f32,
29112 yaw: 0.0_f32,
29113 yaw_rate: 0.0_f32,
29114 type_mask: PositionTargetTypemask::DEFAULT,
29115 target_system: 0_u8,
29116 target_component: 0_u8,
29117 coordinate_frame: MavFrame::DEFAULT,
29118 };
29119 #[cfg(feature = "arbitrary")]
29120 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29121 use arbitrary::{Arbitrary, Unstructured};
29122 let mut buf = [0u8; 1024];
29123 rng.fill_bytes(&mut buf);
29124 let mut unstructured = Unstructured::new(&buf);
29125 Self::arbitrary(&mut unstructured).unwrap_or_default()
29126 }
29127}
29128impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
29129 fn default() -> Self {
29130 Self::DEFAULT.clone()
29131 }
29132}
29133impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
29134 type Message = MavMessage;
29135 const ID: u32 = 84u32;
29136 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
29137 const EXTRA_CRC: u8 = 143u8;
29138 const ENCODED_LEN: usize = 53usize;
29139 fn deser(
29140 _version: MavlinkVersion,
29141 __input: &[u8],
29142 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29143 let avail_len = __input.len();
29144 let mut payload_buf = [0; Self::ENCODED_LEN];
29145 let mut buf = if avail_len < Self::ENCODED_LEN {
29146 payload_buf[0..avail_len].copy_from_slice(__input);
29147 Bytes::new(&payload_buf)
29148 } else {
29149 Bytes::new(__input)
29150 };
29151 let mut __struct = Self::default();
29152 __struct.time_boot_ms = buf.get_u32_le()?;
29153 __struct.x = buf.get_f32_le()?;
29154 __struct.y = buf.get_f32_le()?;
29155 __struct.z = buf.get_f32_le()?;
29156 __struct.vx = buf.get_f32_le()?;
29157 __struct.vy = buf.get_f32_le()?;
29158 __struct.vz = buf.get_f32_le()?;
29159 __struct.afx = buf.get_f32_le()?;
29160 __struct.afy = buf.get_f32_le()?;
29161 __struct.afz = buf.get_f32_le()?;
29162 __struct.yaw = buf.get_f32_le()?;
29163 __struct.yaw_rate = buf.get_f32_le()?;
29164 let tmp = buf.get_u16_le()?;
29165 __struct.type_mask =
29166 PositionTargetTypemask::from_bits(tmp as <PositionTargetTypemask as Flags>::Bits)
29167 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29168 flag_type: "PositionTargetTypemask",
29169 value: tmp as u64,
29170 })?;
29171 __struct.target_system = buf.get_u8()?;
29172 __struct.target_component = buf.get_u8()?;
29173 let tmp = buf.get_u8()?;
29174 __struct.coordinate_frame =
29175 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29176 enum_type: "MavFrame",
29177 value: tmp as u64,
29178 })?;
29179 Ok(__struct)
29180 }
29181 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29182 let mut __tmp = BytesMut::new(bytes);
29183 #[allow(clippy::absurd_extreme_comparisons)]
29184 #[allow(unused_comparisons)]
29185 if __tmp.remaining() < Self::ENCODED_LEN {
29186 panic!(
29187 "buffer is too small (need {} bytes, but got {})",
29188 Self::ENCODED_LEN,
29189 __tmp.remaining(),
29190 )
29191 }
29192 __tmp.put_u32_le(self.time_boot_ms);
29193 __tmp.put_f32_le(self.x);
29194 __tmp.put_f32_le(self.y);
29195 __tmp.put_f32_le(self.z);
29196 __tmp.put_f32_le(self.vx);
29197 __tmp.put_f32_le(self.vy);
29198 __tmp.put_f32_le(self.vz);
29199 __tmp.put_f32_le(self.afx);
29200 __tmp.put_f32_le(self.afy);
29201 __tmp.put_f32_le(self.afz);
29202 __tmp.put_f32_le(self.yaw);
29203 __tmp.put_f32_le(self.yaw_rate);
29204 __tmp.put_u16_le(self.type_mask.bits() as u16);
29205 __tmp.put_u8(self.target_system);
29206 __tmp.put_u8(self.target_component);
29207 __tmp.put_u8(self.coordinate_frame as u8);
29208 if matches!(version, MavlinkVersion::V2) {
29209 let len = __tmp.len();
29210 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29211 } else {
29212 __tmp.len()
29213 }
29214 }
29215}
29216#[doc = "Status of simulation environment, if used."]
29217#[doc = ""]
29218#[doc = "ID: 108"]
29219#[derive(Debug, Clone, PartialEq)]
29220#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29221#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29222#[cfg_attr(feature = "ts", derive(TS))]
29223#[cfg_attr(feature = "ts", ts(export))]
29224pub struct SIM_STATE_DATA {
29225 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
29226 pub q1: f32,
29227 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
29228 pub q2: f32,
29229 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
29230 pub q3: f32,
29231 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
29232 pub q4: f32,
29233 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
29234 pub roll: f32,
29235 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
29236 pub pitch: f32,
29237 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
29238 pub yaw: f32,
29239 #[doc = "X acceleration"]
29240 pub xacc: f32,
29241 #[doc = "Y acceleration"]
29242 pub yacc: f32,
29243 #[doc = "Z acceleration"]
29244 pub zacc: f32,
29245 #[doc = "Angular speed around X axis"]
29246 pub xgyro: f32,
29247 #[doc = "Angular speed around Y axis"]
29248 pub ygyro: f32,
29249 #[doc = "Angular speed around Z axis"]
29250 pub zgyro: f32,
29251 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
29252 pub lat: f32,
29253 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
29254 pub lon: f32,
29255 #[doc = "Altitude"]
29256 pub alt: f32,
29257 #[doc = "Horizontal position standard deviation"]
29258 pub std_dev_horz: f32,
29259 #[doc = "Vertical position standard deviation"]
29260 pub std_dev_vert: f32,
29261 #[doc = "True velocity in north direction in earth-fixed NED frame"]
29262 pub vn: f32,
29263 #[doc = "True velocity in east direction in earth-fixed NED frame"]
29264 pub ve: f32,
29265 #[doc = "True velocity in down direction in earth-fixed NED frame"]
29266 pub vd: f32,
29267 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
29268 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29269 pub lat_int: i32,
29270 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
29271 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29272 pub lon_int: i32,
29273}
29274impl SIM_STATE_DATA {
29275 pub const ENCODED_LEN: usize = 92usize;
29276 pub const DEFAULT: Self = Self {
29277 q1: 0.0_f32,
29278 q2: 0.0_f32,
29279 q3: 0.0_f32,
29280 q4: 0.0_f32,
29281 roll: 0.0_f32,
29282 pitch: 0.0_f32,
29283 yaw: 0.0_f32,
29284 xacc: 0.0_f32,
29285 yacc: 0.0_f32,
29286 zacc: 0.0_f32,
29287 xgyro: 0.0_f32,
29288 ygyro: 0.0_f32,
29289 zgyro: 0.0_f32,
29290 lat: 0.0_f32,
29291 lon: 0.0_f32,
29292 alt: 0.0_f32,
29293 std_dev_horz: 0.0_f32,
29294 std_dev_vert: 0.0_f32,
29295 vn: 0.0_f32,
29296 ve: 0.0_f32,
29297 vd: 0.0_f32,
29298 lat_int: 0_i32,
29299 lon_int: 0_i32,
29300 };
29301 #[cfg(feature = "arbitrary")]
29302 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29303 use arbitrary::{Arbitrary, Unstructured};
29304 let mut buf = [0u8; 1024];
29305 rng.fill_bytes(&mut buf);
29306 let mut unstructured = Unstructured::new(&buf);
29307 Self::arbitrary(&mut unstructured).unwrap_or_default()
29308 }
29309}
29310impl Default for SIM_STATE_DATA {
29311 fn default() -> Self {
29312 Self::DEFAULT.clone()
29313 }
29314}
29315impl MessageData for SIM_STATE_DATA {
29316 type Message = MavMessage;
29317 const ID: u32 = 108u32;
29318 const NAME: &'static str = "SIM_STATE";
29319 const EXTRA_CRC: u8 = 32u8;
29320 const ENCODED_LEN: usize = 92usize;
29321 fn deser(
29322 _version: MavlinkVersion,
29323 __input: &[u8],
29324 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29325 let avail_len = __input.len();
29326 let mut payload_buf = [0; Self::ENCODED_LEN];
29327 let mut buf = if avail_len < Self::ENCODED_LEN {
29328 payload_buf[0..avail_len].copy_from_slice(__input);
29329 Bytes::new(&payload_buf)
29330 } else {
29331 Bytes::new(__input)
29332 };
29333 let mut __struct = Self::default();
29334 __struct.q1 = buf.get_f32_le()?;
29335 __struct.q2 = buf.get_f32_le()?;
29336 __struct.q3 = buf.get_f32_le()?;
29337 __struct.q4 = buf.get_f32_le()?;
29338 __struct.roll = buf.get_f32_le()?;
29339 __struct.pitch = buf.get_f32_le()?;
29340 __struct.yaw = buf.get_f32_le()?;
29341 __struct.xacc = buf.get_f32_le()?;
29342 __struct.yacc = buf.get_f32_le()?;
29343 __struct.zacc = buf.get_f32_le()?;
29344 __struct.xgyro = buf.get_f32_le()?;
29345 __struct.ygyro = buf.get_f32_le()?;
29346 __struct.zgyro = buf.get_f32_le()?;
29347 __struct.lat = buf.get_f32_le()?;
29348 __struct.lon = buf.get_f32_le()?;
29349 __struct.alt = buf.get_f32_le()?;
29350 __struct.std_dev_horz = buf.get_f32_le()?;
29351 __struct.std_dev_vert = buf.get_f32_le()?;
29352 __struct.vn = buf.get_f32_le()?;
29353 __struct.ve = buf.get_f32_le()?;
29354 __struct.vd = buf.get_f32_le()?;
29355 __struct.lat_int = buf.get_i32_le()?;
29356 __struct.lon_int = buf.get_i32_le()?;
29357 Ok(__struct)
29358 }
29359 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29360 let mut __tmp = BytesMut::new(bytes);
29361 #[allow(clippy::absurd_extreme_comparisons)]
29362 #[allow(unused_comparisons)]
29363 if __tmp.remaining() < Self::ENCODED_LEN {
29364 panic!(
29365 "buffer is too small (need {} bytes, but got {})",
29366 Self::ENCODED_LEN,
29367 __tmp.remaining(),
29368 )
29369 }
29370 __tmp.put_f32_le(self.q1);
29371 __tmp.put_f32_le(self.q2);
29372 __tmp.put_f32_le(self.q3);
29373 __tmp.put_f32_le(self.q4);
29374 __tmp.put_f32_le(self.roll);
29375 __tmp.put_f32_le(self.pitch);
29376 __tmp.put_f32_le(self.yaw);
29377 __tmp.put_f32_le(self.xacc);
29378 __tmp.put_f32_le(self.yacc);
29379 __tmp.put_f32_le(self.zacc);
29380 __tmp.put_f32_le(self.xgyro);
29381 __tmp.put_f32_le(self.ygyro);
29382 __tmp.put_f32_le(self.zgyro);
29383 __tmp.put_f32_le(self.lat);
29384 __tmp.put_f32_le(self.lon);
29385 __tmp.put_f32_le(self.alt);
29386 __tmp.put_f32_le(self.std_dev_horz);
29387 __tmp.put_f32_le(self.std_dev_vert);
29388 __tmp.put_f32_le(self.vn);
29389 __tmp.put_f32_le(self.ve);
29390 __tmp.put_f32_le(self.vd);
29391 if matches!(version, MavlinkVersion::V2) {
29392 __tmp.put_i32_le(self.lat_int);
29393 __tmp.put_i32_le(self.lon_int);
29394 let len = __tmp.len();
29395 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29396 } else {
29397 __tmp.len()
29398 }
29399 }
29400}
29401#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
29402#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
29403#[doc = ""]
29404#[doc = "ID: 370"]
29405#[derive(Debug, Clone, PartialEq)]
29406#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29408#[cfg_attr(feature = "ts", derive(TS))]
29409#[cfg_attr(feature = "ts", ts(export))]
29410pub struct SMART_BATTERY_INFO_DATA {
29411 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
29412 pub capacity_full_specification: i32,
29413 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
29414 pub capacity_full: i32,
29415 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
29416 pub cycle_count: u16,
29417 #[doc = "Battery weight. 0: field not provided."]
29418 pub weight: u16,
29419 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
29420 pub discharge_minimum_voltage: u16,
29421 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
29422 pub charging_minimum_voltage: u16,
29423 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
29424 pub resting_minimum_voltage: u16,
29425 #[doc = "Battery ID"]
29426 pub id: u8,
29427 #[doc = "Function of the battery"]
29428 pub battery_function: MavBatteryFunction,
29429 #[doc = "Type (chemistry) of the battery"]
29430 pub mavtype: MavBatteryType,
29431 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
29432 #[cfg_attr(feature = "ts", ts(type = "string"))]
29433 pub serial_number: CharArray<16>,
29434 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
29435 #[cfg_attr(feature = "ts", ts(type = "string"))]
29436 pub device_name: CharArray<50>,
29437 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
29438 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29439 pub charging_maximum_voltage: u16,
29440 #[doc = "Number of battery cells in series. 0: field not provided."]
29441 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29442 pub cells_in_series: u8,
29443 #[doc = "Maximum pack discharge current. 0: field not provided."]
29444 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29445 pub discharge_maximum_current: u32,
29446 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
29447 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29448 pub discharge_maximum_burst_current: u32,
29449 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
29450 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29451 #[cfg_attr(feature = "ts", ts(type = "string"))]
29452 pub manufacture_date: CharArray<11>,
29453}
29454impl SMART_BATTERY_INFO_DATA {
29455 pub const ENCODED_LEN: usize = 109usize;
29456 pub const DEFAULT: Self = Self {
29457 capacity_full_specification: 0_i32,
29458 capacity_full: 0_i32,
29459 cycle_count: 0_u16,
29460 weight: 0_u16,
29461 discharge_minimum_voltage: 0_u16,
29462 charging_minimum_voltage: 0_u16,
29463 resting_minimum_voltage: 0_u16,
29464 id: 0_u8,
29465 battery_function: MavBatteryFunction::DEFAULT,
29466 mavtype: MavBatteryType::DEFAULT,
29467 serial_number: CharArray::new([0_u8; 16usize]),
29468 device_name: CharArray::new([0_u8; 50usize]),
29469 charging_maximum_voltage: 0_u16,
29470 cells_in_series: 0_u8,
29471 discharge_maximum_current: 0_u32,
29472 discharge_maximum_burst_current: 0_u32,
29473 manufacture_date: CharArray::new([0_u8; 11usize]),
29474 };
29475 #[cfg(feature = "arbitrary")]
29476 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29477 use arbitrary::{Arbitrary, Unstructured};
29478 let mut buf = [0u8; 1024];
29479 rng.fill_bytes(&mut buf);
29480 let mut unstructured = Unstructured::new(&buf);
29481 Self::arbitrary(&mut unstructured).unwrap_or_default()
29482 }
29483}
29484impl Default for SMART_BATTERY_INFO_DATA {
29485 fn default() -> Self {
29486 Self::DEFAULT.clone()
29487 }
29488}
29489impl MessageData for SMART_BATTERY_INFO_DATA {
29490 type Message = MavMessage;
29491 const ID: u32 = 370u32;
29492 const NAME: &'static str = "SMART_BATTERY_INFO";
29493 const EXTRA_CRC: u8 = 75u8;
29494 const ENCODED_LEN: usize = 109usize;
29495 fn deser(
29496 _version: MavlinkVersion,
29497 __input: &[u8],
29498 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29499 let avail_len = __input.len();
29500 let mut payload_buf = [0; Self::ENCODED_LEN];
29501 let mut buf = if avail_len < Self::ENCODED_LEN {
29502 payload_buf[0..avail_len].copy_from_slice(__input);
29503 Bytes::new(&payload_buf)
29504 } else {
29505 Bytes::new(__input)
29506 };
29507 let mut __struct = Self::default();
29508 __struct.capacity_full_specification = buf.get_i32_le()?;
29509 __struct.capacity_full = buf.get_i32_le()?;
29510 __struct.cycle_count = buf.get_u16_le()?;
29511 __struct.weight = buf.get_u16_le()?;
29512 __struct.discharge_minimum_voltage = buf.get_u16_le()?;
29513 __struct.charging_minimum_voltage = buf.get_u16_le()?;
29514 __struct.resting_minimum_voltage = buf.get_u16_le()?;
29515 __struct.id = buf.get_u8()?;
29516 let tmp = buf.get_u8()?;
29517 __struct.battery_function =
29518 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29519 enum_type: "MavBatteryFunction",
29520 value: tmp as u64,
29521 })?;
29522 let tmp = buf.get_u8()?;
29523 __struct.mavtype =
29524 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29525 enum_type: "MavBatteryType",
29526 value: tmp as u64,
29527 })?;
29528 let mut tmp = [0_u8; 16usize];
29529 for v in &mut tmp {
29530 *v = buf.get_u8()?;
29531 }
29532 __struct.serial_number = CharArray::new(tmp);
29533 let mut tmp = [0_u8; 50usize];
29534 for v in &mut tmp {
29535 *v = buf.get_u8()?;
29536 }
29537 __struct.device_name = CharArray::new(tmp);
29538 __struct.charging_maximum_voltage = buf.get_u16_le()?;
29539 __struct.cells_in_series = buf.get_u8()?;
29540 __struct.discharge_maximum_current = buf.get_u32_le()?;
29541 __struct.discharge_maximum_burst_current = buf.get_u32_le()?;
29542 let mut tmp = [0_u8; 11usize];
29543 for v in &mut tmp {
29544 *v = buf.get_u8()?;
29545 }
29546 __struct.manufacture_date = CharArray::new(tmp);
29547 Ok(__struct)
29548 }
29549 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29550 let mut __tmp = BytesMut::new(bytes);
29551 #[allow(clippy::absurd_extreme_comparisons)]
29552 #[allow(unused_comparisons)]
29553 if __tmp.remaining() < Self::ENCODED_LEN {
29554 panic!(
29555 "buffer is too small (need {} bytes, but got {})",
29556 Self::ENCODED_LEN,
29557 __tmp.remaining(),
29558 )
29559 }
29560 __tmp.put_i32_le(self.capacity_full_specification);
29561 __tmp.put_i32_le(self.capacity_full);
29562 __tmp.put_u16_le(self.cycle_count);
29563 __tmp.put_u16_le(self.weight);
29564 __tmp.put_u16_le(self.discharge_minimum_voltage);
29565 __tmp.put_u16_le(self.charging_minimum_voltage);
29566 __tmp.put_u16_le(self.resting_minimum_voltage);
29567 __tmp.put_u8(self.id);
29568 __tmp.put_u8(self.battery_function as u8);
29569 __tmp.put_u8(self.mavtype as u8);
29570 for val in &self.serial_number {
29571 __tmp.put_u8(*val);
29572 }
29573 for val in &self.device_name {
29574 __tmp.put_u8(*val);
29575 }
29576 if matches!(version, MavlinkVersion::V2) {
29577 __tmp.put_u16_le(self.charging_maximum_voltage);
29578 __tmp.put_u8(self.cells_in_series);
29579 __tmp.put_u32_le(self.discharge_maximum_current);
29580 __tmp.put_u32_le(self.discharge_maximum_burst_current);
29581 for val in &self.manufacture_date {
29582 __tmp.put_u8(*val);
29583 }
29584 let len = __tmp.len();
29585 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29586 } else {
29587 __tmp.len()
29588 }
29589 }
29590}
29591#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
29592#[doc = ""]
29593#[doc = "ID: 253"]
29594#[derive(Debug, Clone, PartialEq)]
29595#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29596#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29597#[cfg_attr(feature = "ts", derive(TS))]
29598#[cfg_attr(feature = "ts", ts(export))]
29599pub struct STATUSTEXT_DATA {
29600 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
29601 pub severity: MavSeverity,
29602 #[doc = "Status text message, without null termination character"]
29603 #[cfg_attr(feature = "ts", ts(type = "string"))]
29604 pub text: CharArray<50>,
29605 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
29606 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29607 pub id: u16,
29608 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
29609 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29610 pub chunk_seq: u8,
29611}
29612impl STATUSTEXT_DATA {
29613 pub const ENCODED_LEN: usize = 54usize;
29614 pub const DEFAULT: Self = Self {
29615 severity: MavSeverity::DEFAULT,
29616 text: CharArray::new([0_u8; 50usize]),
29617 id: 0_u16,
29618 chunk_seq: 0_u8,
29619 };
29620 #[cfg(feature = "arbitrary")]
29621 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29622 use arbitrary::{Arbitrary, Unstructured};
29623 let mut buf = [0u8; 1024];
29624 rng.fill_bytes(&mut buf);
29625 let mut unstructured = Unstructured::new(&buf);
29626 Self::arbitrary(&mut unstructured).unwrap_or_default()
29627 }
29628}
29629impl Default for STATUSTEXT_DATA {
29630 fn default() -> Self {
29631 Self::DEFAULT.clone()
29632 }
29633}
29634impl MessageData for STATUSTEXT_DATA {
29635 type Message = MavMessage;
29636 const ID: u32 = 253u32;
29637 const NAME: &'static str = "STATUSTEXT";
29638 const EXTRA_CRC: u8 = 83u8;
29639 const ENCODED_LEN: usize = 54usize;
29640 fn deser(
29641 _version: MavlinkVersion,
29642 __input: &[u8],
29643 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29644 let avail_len = __input.len();
29645 let mut payload_buf = [0; Self::ENCODED_LEN];
29646 let mut buf = if avail_len < Self::ENCODED_LEN {
29647 payload_buf[0..avail_len].copy_from_slice(__input);
29648 Bytes::new(&payload_buf)
29649 } else {
29650 Bytes::new(__input)
29651 };
29652 let mut __struct = Self::default();
29653 let tmp = buf.get_u8()?;
29654 __struct.severity =
29655 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29656 enum_type: "MavSeverity",
29657 value: tmp as u64,
29658 })?;
29659 let mut tmp = [0_u8; 50usize];
29660 for v in &mut tmp {
29661 *v = buf.get_u8()?;
29662 }
29663 __struct.text = CharArray::new(tmp);
29664 __struct.id = buf.get_u16_le()?;
29665 __struct.chunk_seq = buf.get_u8()?;
29666 Ok(__struct)
29667 }
29668 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29669 let mut __tmp = BytesMut::new(bytes);
29670 #[allow(clippy::absurd_extreme_comparisons)]
29671 #[allow(unused_comparisons)]
29672 if __tmp.remaining() < Self::ENCODED_LEN {
29673 panic!(
29674 "buffer is too small (need {} bytes, but got {})",
29675 Self::ENCODED_LEN,
29676 __tmp.remaining(),
29677 )
29678 }
29679 __tmp.put_u8(self.severity as u8);
29680 for val in &self.text {
29681 __tmp.put_u8(*val);
29682 }
29683 if matches!(version, MavlinkVersion::V2) {
29684 __tmp.put_u16_le(self.id);
29685 __tmp.put_u8(self.chunk_seq);
29686 let len = __tmp.len();
29687 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29688 } else {
29689 __tmp.len()
29690 }
29691 }
29692}
29693#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
29694#[doc = ""]
29695#[doc = "ID: 261"]
29696#[derive(Debug, Clone, PartialEq)]
29697#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29698#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29699#[cfg_attr(feature = "ts", derive(TS))]
29700#[cfg_attr(feature = "ts", ts(export))]
29701pub struct STORAGE_INFORMATION_DATA {
29702 #[doc = "Timestamp (time since system boot)."]
29703 pub time_boot_ms: u32,
29704 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29705 pub total_capacity: f32,
29706 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29707 pub used_capacity: f32,
29708 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
29709 pub available_capacity: f32,
29710 #[doc = "Read speed."]
29711 pub read_speed: f32,
29712 #[doc = "Write speed."]
29713 pub write_speed: f32,
29714 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
29715 pub storage_id: u8,
29716 #[doc = "Number of storage devices"]
29717 pub storage_count: u8,
29718 #[doc = "Status of storage"]
29719 pub status: StorageStatus,
29720 #[doc = "Type of storage"]
29721 #[cfg_attr(feature = "serde", serde(default))]
29722 pub mavtype: StorageType,
29723 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
29724 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29725 #[cfg_attr(feature = "ts", ts(type = "string"))]
29726 pub name: CharArray<32>,
29727 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
29728 #[cfg_attr(feature = "serde", serde(default))]
29729 pub storage_usage: StorageUsageFlag,
29730}
29731impl STORAGE_INFORMATION_DATA {
29732 pub const ENCODED_LEN: usize = 61usize;
29733 pub const DEFAULT: Self = Self {
29734 time_boot_ms: 0_u32,
29735 total_capacity: 0.0_f32,
29736 used_capacity: 0.0_f32,
29737 available_capacity: 0.0_f32,
29738 read_speed: 0.0_f32,
29739 write_speed: 0.0_f32,
29740 storage_id: 0_u8,
29741 storage_count: 0_u8,
29742 status: StorageStatus::DEFAULT,
29743 mavtype: StorageType::DEFAULT,
29744 name: CharArray::new([0_u8; 32usize]),
29745 storage_usage: StorageUsageFlag::DEFAULT,
29746 };
29747 #[cfg(feature = "arbitrary")]
29748 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29749 use arbitrary::{Arbitrary, Unstructured};
29750 let mut buf = [0u8; 1024];
29751 rng.fill_bytes(&mut buf);
29752 let mut unstructured = Unstructured::new(&buf);
29753 Self::arbitrary(&mut unstructured).unwrap_or_default()
29754 }
29755}
29756impl Default for STORAGE_INFORMATION_DATA {
29757 fn default() -> Self {
29758 Self::DEFAULT.clone()
29759 }
29760}
29761impl MessageData for STORAGE_INFORMATION_DATA {
29762 type Message = MavMessage;
29763 const ID: u32 = 261u32;
29764 const NAME: &'static str = "STORAGE_INFORMATION";
29765 const EXTRA_CRC: u8 = 179u8;
29766 const ENCODED_LEN: usize = 61usize;
29767 fn deser(
29768 _version: MavlinkVersion,
29769 __input: &[u8],
29770 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29771 let avail_len = __input.len();
29772 let mut payload_buf = [0; Self::ENCODED_LEN];
29773 let mut buf = if avail_len < Self::ENCODED_LEN {
29774 payload_buf[0..avail_len].copy_from_slice(__input);
29775 Bytes::new(&payload_buf)
29776 } else {
29777 Bytes::new(__input)
29778 };
29779 let mut __struct = Self::default();
29780 __struct.time_boot_ms = buf.get_u32_le()?;
29781 __struct.total_capacity = buf.get_f32_le()?;
29782 __struct.used_capacity = buf.get_f32_le()?;
29783 __struct.available_capacity = buf.get_f32_le()?;
29784 __struct.read_speed = buf.get_f32_le()?;
29785 __struct.write_speed = buf.get_f32_le()?;
29786 __struct.storage_id = buf.get_u8()?;
29787 __struct.storage_count = buf.get_u8()?;
29788 let tmp = buf.get_u8()?;
29789 __struct.status =
29790 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29791 enum_type: "StorageStatus",
29792 value: tmp as u64,
29793 })?;
29794 let tmp = buf.get_u8()?;
29795 __struct.mavtype =
29796 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29797 enum_type: "StorageType",
29798 value: tmp as u64,
29799 })?;
29800 let mut tmp = [0_u8; 32usize];
29801 for v in &mut tmp {
29802 *v = buf.get_u8()?;
29803 }
29804 __struct.name = CharArray::new(tmp);
29805 let tmp = buf.get_u8()?;
29806 __struct.storage_usage = StorageUsageFlag::from_bits(
29807 tmp as <StorageUsageFlag as Flags>::Bits,
29808 )
29809 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
29810 flag_type: "StorageUsageFlag",
29811 value: tmp as u64,
29812 })?;
29813 Ok(__struct)
29814 }
29815 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29816 let mut __tmp = BytesMut::new(bytes);
29817 #[allow(clippy::absurd_extreme_comparisons)]
29818 #[allow(unused_comparisons)]
29819 if __tmp.remaining() < Self::ENCODED_LEN {
29820 panic!(
29821 "buffer is too small (need {} bytes, but got {})",
29822 Self::ENCODED_LEN,
29823 __tmp.remaining(),
29824 )
29825 }
29826 __tmp.put_u32_le(self.time_boot_ms);
29827 __tmp.put_f32_le(self.total_capacity);
29828 __tmp.put_f32_le(self.used_capacity);
29829 __tmp.put_f32_le(self.available_capacity);
29830 __tmp.put_f32_le(self.read_speed);
29831 __tmp.put_f32_le(self.write_speed);
29832 __tmp.put_u8(self.storage_id);
29833 __tmp.put_u8(self.storage_count);
29834 __tmp.put_u8(self.status as u8);
29835 if matches!(version, MavlinkVersion::V2) {
29836 __tmp.put_u8(self.mavtype as u8);
29837 for val in &self.name {
29838 __tmp.put_u8(*val);
29839 }
29840 __tmp.put_u8(self.storage_usage.bits() as u8);
29841 let len = __tmp.len();
29842 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29843 } else {
29844 __tmp.len()
29845 }
29846 }
29847}
29848#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
29849#[doc = ""]
29850#[doc = "ID: 401"]
29851#[derive(Debug, Clone, PartialEq)]
29852#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29853#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29854#[cfg_attr(feature = "ts", derive(TS))]
29855#[cfg_attr(feature = "ts", ts(export))]
29856pub struct SUPPORTED_TUNES_DATA {
29857 #[doc = "Bitfield of supported tune formats."]
29858 pub format: TuneFormat,
29859 #[doc = "System ID"]
29860 pub target_system: u8,
29861 #[doc = "Component ID"]
29862 pub target_component: u8,
29863}
29864impl SUPPORTED_TUNES_DATA {
29865 pub const ENCODED_LEN: usize = 6usize;
29866 pub const DEFAULT: Self = Self {
29867 format: TuneFormat::DEFAULT,
29868 target_system: 0_u8,
29869 target_component: 0_u8,
29870 };
29871 #[cfg(feature = "arbitrary")]
29872 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29873 use arbitrary::{Arbitrary, Unstructured};
29874 let mut buf = [0u8; 1024];
29875 rng.fill_bytes(&mut buf);
29876 let mut unstructured = Unstructured::new(&buf);
29877 Self::arbitrary(&mut unstructured).unwrap_or_default()
29878 }
29879}
29880impl Default for SUPPORTED_TUNES_DATA {
29881 fn default() -> Self {
29882 Self::DEFAULT.clone()
29883 }
29884}
29885impl MessageData for SUPPORTED_TUNES_DATA {
29886 type Message = MavMessage;
29887 const ID: u32 = 401u32;
29888 const NAME: &'static str = "SUPPORTED_TUNES";
29889 const EXTRA_CRC: u8 = 183u8;
29890 const ENCODED_LEN: usize = 6usize;
29891 fn deser(
29892 _version: MavlinkVersion,
29893 __input: &[u8],
29894 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29895 let avail_len = __input.len();
29896 let mut payload_buf = [0; Self::ENCODED_LEN];
29897 let mut buf = if avail_len < Self::ENCODED_LEN {
29898 payload_buf[0..avail_len].copy_from_slice(__input);
29899 Bytes::new(&payload_buf)
29900 } else {
29901 Bytes::new(__input)
29902 };
29903 let mut __struct = Self::default();
29904 let tmp = buf.get_u32_le()?;
29905 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
29906 ::mavlink_core::error::ParserError::InvalidEnum {
29907 enum_type: "TuneFormat",
29908 value: tmp as u64,
29909 },
29910 )?;
29911 __struct.target_system = buf.get_u8()?;
29912 __struct.target_component = buf.get_u8()?;
29913 Ok(__struct)
29914 }
29915 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29916 let mut __tmp = BytesMut::new(bytes);
29917 #[allow(clippy::absurd_extreme_comparisons)]
29918 #[allow(unused_comparisons)]
29919 if __tmp.remaining() < Self::ENCODED_LEN {
29920 panic!(
29921 "buffer is too small (need {} bytes, but got {})",
29922 Self::ENCODED_LEN,
29923 __tmp.remaining(),
29924 )
29925 }
29926 __tmp.put_u32_le(self.format as u32);
29927 __tmp.put_u8(self.target_system);
29928 __tmp.put_u8(self.target_component);
29929 if matches!(version, MavlinkVersion::V2) {
29930 let len = __tmp.len();
29931 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29932 } else {
29933 __tmp.len()
29934 }
29935 }
29936}
29937#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
29938#[doc = ""]
29939#[doc = "ID: 2"]
29940#[derive(Debug, Clone, PartialEq)]
29941#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29942#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29943#[cfg_attr(feature = "ts", derive(TS))]
29944#[cfg_attr(feature = "ts", ts(export))]
29945pub struct SYSTEM_TIME_DATA {
29946 #[doc = "Timestamp (UNIX epoch time)."]
29947 pub time_unix_usec: u64,
29948 #[doc = "Timestamp (time since system boot)."]
29949 pub time_boot_ms: u32,
29950}
29951impl SYSTEM_TIME_DATA {
29952 pub const ENCODED_LEN: usize = 12usize;
29953 pub const DEFAULT: Self = Self {
29954 time_unix_usec: 0_u64,
29955 time_boot_ms: 0_u32,
29956 };
29957 #[cfg(feature = "arbitrary")]
29958 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29959 use arbitrary::{Arbitrary, Unstructured};
29960 let mut buf = [0u8; 1024];
29961 rng.fill_bytes(&mut buf);
29962 let mut unstructured = Unstructured::new(&buf);
29963 Self::arbitrary(&mut unstructured).unwrap_or_default()
29964 }
29965}
29966impl Default for SYSTEM_TIME_DATA {
29967 fn default() -> Self {
29968 Self::DEFAULT.clone()
29969 }
29970}
29971impl MessageData for SYSTEM_TIME_DATA {
29972 type Message = MavMessage;
29973 const ID: u32 = 2u32;
29974 const NAME: &'static str = "SYSTEM_TIME";
29975 const EXTRA_CRC: u8 = 137u8;
29976 const ENCODED_LEN: usize = 12usize;
29977 fn deser(
29978 _version: MavlinkVersion,
29979 __input: &[u8],
29980 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29981 let avail_len = __input.len();
29982 let mut payload_buf = [0; Self::ENCODED_LEN];
29983 let mut buf = if avail_len < Self::ENCODED_LEN {
29984 payload_buf[0..avail_len].copy_from_slice(__input);
29985 Bytes::new(&payload_buf)
29986 } else {
29987 Bytes::new(__input)
29988 };
29989 let mut __struct = Self::default();
29990 __struct.time_unix_usec = buf.get_u64_le()?;
29991 __struct.time_boot_ms = buf.get_u32_le()?;
29992 Ok(__struct)
29993 }
29994 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29995 let mut __tmp = BytesMut::new(bytes);
29996 #[allow(clippy::absurd_extreme_comparisons)]
29997 #[allow(unused_comparisons)]
29998 if __tmp.remaining() < Self::ENCODED_LEN {
29999 panic!(
30000 "buffer is too small (need {} bytes, but got {})",
30001 Self::ENCODED_LEN,
30002 __tmp.remaining(),
30003 )
30004 }
30005 __tmp.put_u64_le(self.time_unix_usec);
30006 __tmp.put_u32_le(self.time_boot_ms);
30007 if matches!(version, MavlinkVersion::V2) {
30008 let len = __tmp.len();
30009 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30010 } else {
30011 __tmp.len()
30012 }
30013 }
30014}
30015#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
30016#[doc = ""]
30017#[doc = "ID: 1"]
30018#[derive(Debug, Clone, PartialEq)]
30019#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30020#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30021#[cfg_attr(feature = "ts", derive(TS))]
30022#[cfg_attr(feature = "ts", ts(export))]
30023pub struct SYS_STATUS_DATA {
30024 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
30025 pub onboard_control_sensors_present: MavSysStatusSensor,
30026 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
30027 pub onboard_control_sensors_enabled: MavSysStatusSensor,
30028 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
30029 pub onboard_control_sensors_health: MavSysStatusSensor,
30030 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
30031 pub load: u16,
30032 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
30033 pub voltage_battery: u16,
30034 #[doc = "Battery current, -1: Current not sent by autopilot"]
30035 pub current_battery: i16,
30036 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
30037 pub drop_rate_comm: u16,
30038 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
30039 pub errors_comm: u16,
30040 #[doc = "Autopilot-specific errors"]
30041 pub errors_count1: u16,
30042 #[doc = "Autopilot-specific errors"]
30043 pub errors_count2: u16,
30044 #[doc = "Autopilot-specific errors"]
30045 pub errors_count3: u16,
30046 #[doc = "Autopilot-specific errors"]
30047 pub errors_count4: u16,
30048 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
30049 pub battery_remaining: i8,
30050 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
30051 #[cfg_attr(feature = "serde", serde(default))]
30052 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
30053 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
30054 #[cfg_attr(feature = "serde", serde(default))]
30055 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
30056 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
30057 #[cfg_attr(feature = "serde", serde(default))]
30058 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
30059}
30060impl SYS_STATUS_DATA {
30061 pub const ENCODED_LEN: usize = 43usize;
30062 pub const DEFAULT: Self = Self {
30063 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
30064 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
30065 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
30066 load: 0_u16,
30067 voltage_battery: 0_u16,
30068 current_battery: 0_i16,
30069 drop_rate_comm: 0_u16,
30070 errors_comm: 0_u16,
30071 errors_count1: 0_u16,
30072 errors_count2: 0_u16,
30073 errors_count3: 0_u16,
30074 errors_count4: 0_u16,
30075 battery_remaining: 0_i8,
30076 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
30077 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
30078 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
30079 };
30080 #[cfg(feature = "arbitrary")]
30081 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30082 use arbitrary::{Arbitrary, Unstructured};
30083 let mut buf = [0u8; 1024];
30084 rng.fill_bytes(&mut buf);
30085 let mut unstructured = Unstructured::new(&buf);
30086 Self::arbitrary(&mut unstructured).unwrap_or_default()
30087 }
30088}
30089impl Default for SYS_STATUS_DATA {
30090 fn default() -> Self {
30091 Self::DEFAULT.clone()
30092 }
30093}
30094impl MessageData for SYS_STATUS_DATA {
30095 type Message = MavMessage;
30096 const ID: u32 = 1u32;
30097 const NAME: &'static str = "SYS_STATUS";
30098 const EXTRA_CRC: u8 = 124u8;
30099 const ENCODED_LEN: usize = 43usize;
30100 fn deser(
30101 _version: MavlinkVersion,
30102 __input: &[u8],
30103 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30104 let avail_len = __input.len();
30105 let mut payload_buf = [0; Self::ENCODED_LEN];
30106 let mut buf = if avail_len < Self::ENCODED_LEN {
30107 payload_buf[0..avail_len].copy_from_slice(__input);
30108 Bytes::new(&payload_buf)
30109 } else {
30110 Bytes::new(__input)
30111 };
30112 let mut __struct = Self::default();
30113 let tmp = buf.get_u32_le()?;
30114 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
30115 tmp as <MavSysStatusSensor as Flags>::Bits,
30116 )
30117 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30118 flag_type: "MavSysStatusSensor",
30119 value: tmp as u64,
30120 })?;
30121 let tmp = buf.get_u32_le()?;
30122 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
30123 tmp as <MavSysStatusSensor as Flags>::Bits,
30124 )
30125 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30126 flag_type: "MavSysStatusSensor",
30127 value: tmp as u64,
30128 })?;
30129 let tmp = buf.get_u32_le()?;
30130 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
30131 tmp as <MavSysStatusSensor as Flags>::Bits,
30132 )
30133 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30134 flag_type: "MavSysStatusSensor",
30135 value: tmp as u64,
30136 })?;
30137 __struct.load = buf.get_u16_le()?;
30138 __struct.voltage_battery = buf.get_u16_le()?;
30139 __struct.current_battery = buf.get_i16_le()?;
30140 __struct.drop_rate_comm = buf.get_u16_le()?;
30141 __struct.errors_comm = buf.get_u16_le()?;
30142 __struct.errors_count1 = buf.get_u16_le()?;
30143 __struct.errors_count2 = buf.get_u16_le()?;
30144 __struct.errors_count3 = buf.get_u16_le()?;
30145 __struct.errors_count4 = buf.get_u16_le()?;
30146 __struct.battery_remaining = buf.get_i8()?;
30147 let tmp = buf.get_u32_le()?;
30148 __struct.onboard_control_sensors_present_extended = MavSysStatusSensorExtended::from_bits(
30149 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
30150 )
30151 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30152 flag_type: "MavSysStatusSensorExtended",
30153 value: tmp as u64,
30154 })?;
30155 let tmp = buf.get_u32_le()?;
30156 __struct.onboard_control_sensors_enabled_extended = MavSysStatusSensorExtended::from_bits(
30157 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
30158 )
30159 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30160 flag_type: "MavSysStatusSensorExtended",
30161 value: tmp as u64,
30162 })?;
30163 let tmp = buf.get_u32_le()?;
30164 __struct.onboard_control_sensors_health_extended = MavSysStatusSensorExtended::from_bits(
30165 tmp as <MavSysStatusSensorExtended as Flags>::Bits,
30166 )
30167 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30168 flag_type: "MavSysStatusSensorExtended",
30169 value: tmp as u64,
30170 })?;
30171 Ok(__struct)
30172 }
30173 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30174 let mut __tmp = BytesMut::new(bytes);
30175 #[allow(clippy::absurd_extreme_comparisons)]
30176 #[allow(unused_comparisons)]
30177 if __tmp.remaining() < Self::ENCODED_LEN {
30178 panic!(
30179 "buffer is too small (need {} bytes, but got {})",
30180 Self::ENCODED_LEN,
30181 __tmp.remaining(),
30182 )
30183 }
30184 __tmp.put_u32_le(self.onboard_control_sensors_present.bits() as u32);
30185 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits() as u32);
30186 __tmp.put_u32_le(self.onboard_control_sensors_health.bits() as u32);
30187 __tmp.put_u16_le(self.load);
30188 __tmp.put_u16_le(self.voltage_battery);
30189 __tmp.put_i16_le(self.current_battery);
30190 __tmp.put_u16_le(self.drop_rate_comm);
30191 __tmp.put_u16_le(self.errors_comm);
30192 __tmp.put_u16_le(self.errors_count1);
30193 __tmp.put_u16_le(self.errors_count2);
30194 __tmp.put_u16_le(self.errors_count3);
30195 __tmp.put_u16_le(self.errors_count4);
30196 __tmp.put_i8(self.battery_remaining);
30197 if matches!(version, MavlinkVersion::V2) {
30198 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits() as u32);
30199 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits() as u32);
30200 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits() as u32);
30201 let len = __tmp.len();
30202 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30203 } else {
30204 __tmp.len()
30205 }
30206 }
30207}
30208#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
30209#[doc = ""]
30210#[doc = "ID: 135"]
30211#[derive(Debug, Clone, PartialEq)]
30212#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30213#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30214#[cfg_attr(feature = "ts", derive(TS))]
30215#[cfg_attr(feature = "ts", ts(export))]
30216pub struct TERRAIN_CHECK_DATA {
30217 #[doc = "Latitude"]
30218 pub lat: i32,
30219 #[doc = "Longitude"]
30220 pub lon: i32,
30221}
30222impl TERRAIN_CHECK_DATA {
30223 pub const ENCODED_LEN: usize = 8usize;
30224 pub const DEFAULT: Self = Self {
30225 lat: 0_i32,
30226 lon: 0_i32,
30227 };
30228 #[cfg(feature = "arbitrary")]
30229 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30230 use arbitrary::{Arbitrary, Unstructured};
30231 let mut buf = [0u8; 1024];
30232 rng.fill_bytes(&mut buf);
30233 let mut unstructured = Unstructured::new(&buf);
30234 Self::arbitrary(&mut unstructured).unwrap_or_default()
30235 }
30236}
30237impl Default for TERRAIN_CHECK_DATA {
30238 fn default() -> Self {
30239 Self::DEFAULT.clone()
30240 }
30241}
30242impl MessageData for TERRAIN_CHECK_DATA {
30243 type Message = MavMessage;
30244 const ID: u32 = 135u32;
30245 const NAME: &'static str = "TERRAIN_CHECK";
30246 const EXTRA_CRC: u8 = 203u8;
30247 const ENCODED_LEN: usize = 8usize;
30248 fn deser(
30249 _version: MavlinkVersion,
30250 __input: &[u8],
30251 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30252 let avail_len = __input.len();
30253 let mut payload_buf = [0; Self::ENCODED_LEN];
30254 let mut buf = if avail_len < Self::ENCODED_LEN {
30255 payload_buf[0..avail_len].copy_from_slice(__input);
30256 Bytes::new(&payload_buf)
30257 } else {
30258 Bytes::new(__input)
30259 };
30260 let mut __struct = Self::default();
30261 __struct.lat = buf.get_i32_le()?;
30262 __struct.lon = buf.get_i32_le()?;
30263 Ok(__struct)
30264 }
30265 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30266 let mut __tmp = BytesMut::new(bytes);
30267 #[allow(clippy::absurd_extreme_comparisons)]
30268 #[allow(unused_comparisons)]
30269 if __tmp.remaining() < Self::ENCODED_LEN {
30270 panic!(
30271 "buffer is too small (need {} bytes, but got {})",
30272 Self::ENCODED_LEN,
30273 __tmp.remaining(),
30274 )
30275 }
30276 __tmp.put_i32_le(self.lat);
30277 __tmp.put_i32_le(self.lon);
30278 if matches!(version, MavlinkVersion::V2) {
30279 let len = __tmp.len();
30280 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30281 } else {
30282 __tmp.len()
30283 }
30284 }
30285}
30286#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
30287#[doc = ""]
30288#[doc = "ID: 134"]
30289#[derive(Debug, Clone, PartialEq)]
30290#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30291#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30292#[cfg_attr(feature = "ts", derive(TS))]
30293#[cfg_attr(feature = "ts", ts(export))]
30294pub struct TERRAIN_DATA_DATA {
30295 #[doc = "Latitude of SW corner of first grid"]
30296 pub lat: i32,
30297 #[doc = "Longitude of SW corner of first grid"]
30298 pub lon: i32,
30299 #[doc = "Grid spacing"]
30300 pub grid_spacing: u16,
30301 #[doc = "Terrain data MSL"]
30302 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30303 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30304 pub data: [i16; 16],
30305 #[doc = "bit within the terrain request mask"]
30306 pub gridbit: u8,
30307}
30308impl TERRAIN_DATA_DATA {
30309 pub const ENCODED_LEN: usize = 43usize;
30310 pub const DEFAULT: Self = Self {
30311 lat: 0_i32,
30312 lon: 0_i32,
30313 grid_spacing: 0_u16,
30314 data: [0_i16; 16usize],
30315 gridbit: 0_u8,
30316 };
30317 #[cfg(feature = "arbitrary")]
30318 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30319 use arbitrary::{Arbitrary, Unstructured};
30320 let mut buf = [0u8; 1024];
30321 rng.fill_bytes(&mut buf);
30322 let mut unstructured = Unstructured::new(&buf);
30323 Self::arbitrary(&mut unstructured).unwrap_or_default()
30324 }
30325}
30326impl Default for TERRAIN_DATA_DATA {
30327 fn default() -> Self {
30328 Self::DEFAULT.clone()
30329 }
30330}
30331impl MessageData for TERRAIN_DATA_DATA {
30332 type Message = MavMessage;
30333 const ID: u32 = 134u32;
30334 const NAME: &'static str = "TERRAIN_DATA";
30335 const EXTRA_CRC: u8 = 229u8;
30336 const ENCODED_LEN: usize = 43usize;
30337 fn deser(
30338 _version: MavlinkVersion,
30339 __input: &[u8],
30340 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30341 let avail_len = __input.len();
30342 let mut payload_buf = [0; Self::ENCODED_LEN];
30343 let mut buf = if avail_len < Self::ENCODED_LEN {
30344 payload_buf[0..avail_len].copy_from_slice(__input);
30345 Bytes::new(&payload_buf)
30346 } else {
30347 Bytes::new(__input)
30348 };
30349 let mut __struct = Self::default();
30350 __struct.lat = buf.get_i32_le()?;
30351 __struct.lon = buf.get_i32_le()?;
30352 __struct.grid_spacing = buf.get_u16_le()?;
30353 for v in &mut __struct.data {
30354 let val = buf.get_i16_le()?;
30355 *v = val;
30356 }
30357 __struct.gridbit = buf.get_u8()?;
30358 Ok(__struct)
30359 }
30360 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30361 let mut __tmp = BytesMut::new(bytes);
30362 #[allow(clippy::absurd_extreme_comparisons)]
30363 #[allow(unused_comparisons)]
30364 if __tmp.remaining() < Self::ENCODED_LEN {
30365 panic!(
30366 "buffer is too small (need {} bytes, but got {})",
30367 Self::ENCODED_LEN,
30368 __tmp.remaining(),
30369 )
30370 }
30371 __tmp.put_i32_le(self.lat);
30372 __tmp.put_i32_le(self.lon);
30373 __tmp.put_u16_le(self.grid_spacing);
30374 for val in &self.data {
30375 __tmp.put_i16_le(*val);
30376 }
30377 __tmp.put_u8(self.gridbit);
30378 if matches!(version, MavlinkVersion::V2) {
30379 let len = __tmp.len();
30380 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30381 } else {
30382 __tmp.len()
30383 }
30384 }
30385}
30386#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
30387#[doc = ""]
30388#[doc = "ID: 136"]
30389#[derive(Debug, Clone, PartialEq)]
30390#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30391#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30392#[cfg_attr(feature = "ts", derive(TS))]
30393#[cfg_attr(feature = "ts", ts(export))]
30394pub struct TERRAIN_REPORT_DATA {
30395 #[doc = "Latitude"]
30396 pub lat: i32,
30397 #[doc = "Longitude"]
30398 pub lon: i32,
30399 #[doc = "Terrain height MSL"]
30400 pub terrain_height: f32,
30401 #[doc = "Current vehicle height above lat/lon terrain height"]
30402 pub current_height: f32,
30403 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
30404 pub spacing: u16,
30405 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
30406 pub pending: u16,
30407 #[doc = "Number of 4x4 terrain blocks in memory"]
30408 pub loaded: u16,
30409}
30410impl TERRAIN_REPORT_DATA {
30411 pub const ENCODED_LEN: usize = 22usize;
30412 pub const DEFAULT: Self = Self {
30413 lat: 0_i32,
30414 lon: 0_i32,
30415 terrain_height: 0.0_f32,
30416 current_height: 0.0_f32,
30417 spacing: 0_u16,
30418 pending: 0_u16,
30419 loaded: 0_u16,
30420 };
30421 #[cfg(feature = "arbitrary")]
30422 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30423 use arbitrary::{Arbitrary, Unstructured};
30424 let mut buf = [0u8; 1024];
30425 rng.fill_bytes(&mut buf);
30426 let mut unstructured = Unstructured::new(&buf);
30427 Self::arbitrary(&mut unstructured).unwrap_or_default()
30428 }
30429}
30430impl Default for TERRAIN_REPORT_DATA {
30431 fn default() -> Self {
30432 Self::DEFAULT.clone()
30433 }
30434}
30435impl MessageData for TERRAIN_REPORT_DATA {
30436 type Message = MavMessage;
30437 const ID: u32 = 136u32;
30438 const NAME: &'static str = "TERRAIN_REPORT";
30439 const EXTRA_CRC: u8 = 1u8;
30440 const ENCODED_LEN: usize = 22usize;
30441 fn deser(
30442 _version: MavlinkVersion,
30443 __input: &[u8],
30444 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30445 let avail_len = __input.len();
30446 let mut payload_buf = [0; Self::ENCODED_LEN];
30447 let mut buf = if avail_len < Self::ENCODED_LEN {
30448 payload_buf[0..avail_len].copy_from_slice(__input);
30449 Bytes::new(&payload_buf)
30450 } else {
30451 Bytes::new(__input)
30452 };
30453 let mut __struct = Self::default();
30454 __struct.lat = buf.get_i32_le()?;
30455 __struct.lon = buf.get_i32_le()?;
30456 __struct.terrain_height = buf.get_f32_le()?;
30457 __struct.current_height = buf.get_f32_le()?;
30458 __struct.spacing = buf.get_u16_le()?;
30459 __struct.pending = buf.get_u16_le()?;
30460 __struct.loaded = buf.get_u16_le()?;
30461 Ok(__struct)
30462 }
30463 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30464 let mut __tmp = BytesMut::new(bytes);
30465 #[allow(clippy::absurd_extreme_comparisons)]
30466 #[allow(unused_comparisons)]
30467 if __tmp.remaining() < Self::ENCODED_LEN {
30468 panic!(
30469 "buffer is too small (need {} bytes, but got {})",
30470 Self::ENCODED_LEN,
30471 __tmp.remaining(),
30472 )
30473 }
30474 __tmp.put_i32_le(self.lat);
30475 __tmp.put_i32_le(self.lon);
30476 __tmp.put_f32_le(self.terrain_height);
30477 __tmp.put_f32_le(self.current_height);
30478 __tmp.put_u16_le(self.spacing);
30479 __tmp.put_u16_le(self.pending);
30480 __tmp.put_u16_le(self.loaded);
30481 if matches!(version, MavlinkVersion::V2) {
30482 let len = __tmp.len();
30483 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30484 } else {
30485 __tmp.len()
30486 }
30487 }
30488}
30489#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
30490#[doc = ""]
30491#[doc = "ID: 133"]
30492#[derive(Debug, Clone, PartialEq)]
30493#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30494#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30495#[cfg_attr(feature = "ts", derive(TS))]
30496#[cfg_attr(feature = "ts", ts(export))]
30497pub struct TERRAIN_REQUEST_DATA {
30498 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
30499 pub mask: u64,
30500 #[doc = "Latitude of SW corner of first grid"]
30501 pub lat: i32,
30502 #[doc = "Longitude of SW corner of first grid"]
30503 pub lon: i32,
30504 #[doc = "Grid spacing"]
30505 pub grid_spacing: u16,
30506}
30507impl TERRAIN_REQUEST_DATA {
30508 pub const ENCODED_LEN: usize = 18usize;
30509 pub const DEFAULT: Self = Self {
30510 mask: 0_u64,
30511 lat: 0_i32,
30512 lon: 0_i32,
30513 grid_spacing: 0_u16,
30514 };
30515 #[cfg(feature = "arbitrary")]
30516 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30517 use arbitrary::{Arbitrary, Unstructured};
30518 let mut buf = [0u8; 1024];
30519 rng.fill_bytes(&mut buf);
30520 let mut unstructured = Unstructured::new(&buf);
30521 Self::arbitrary(&mut unstructured).unwrap_or_default()
30522 }
30523}
30524impl Default for TERRAIN_REQUEST_DATA {
30525 fn default() -> Self {
30526 Self::DEFAULT.clone()
30527 }
30528}
30529impl MessageData for TERRAIN_REQUEST_DATA {
30530 type Message = MavMessage;
30531 const ID: u32 = 133u32;
30532 const NAME: &'static str = "TERRAIN_REQUEST";
30533 const EXTRA_CRC: u8 = 6u8;
30534 const ENCODED_LEN: usize = 18usize;
30535 fn deser(
30536 _version: MavlinkVersion,
30537 __input: &[u8],
30538 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30539 let avail_len = __input.len();
30540 let mut payload_buf = [0; Self::ENCODED_LEN];
30541 let mut buf = if avail_len < Self::ENCODED_LEN {
30542 payload_buf[0..avail_len].copy_from_slice(__input);
30543 Bytes::new(&payload_buf)
30544 } else {
30545 Bytes::new(__input)
30546 };
30547 let mut __struct = Self::default();
30548 __struct.mask = buf.get_u64_le()?;
30549 __struct.lat = buf.get_i32_le()?;
30550 __struct.lon = buf.get_i32_le()?;
30551 __struct.grid_spacing = buf.get_u16_le()?;
30552 Ok(__struct)
30553 }
30554 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30555 let mut __tmp = BytesMut::new(bytes);
30556 #[allow(clippy::absurd_extreme_comparisons)]
30557 #[allow(unused_comparisons)]
30558 if __tmp.remaining() < Self::ENCODED_LEN {
30559 panic!(
30560 "buffer is too small (need {} bytes, but got {})",
30561 Self::ENCODED_LEN,
30562 __tmp.remaining(),
30563 )
30564 }
30565 __tmp.put_u64_le(self.mask);
30566 __tmp.put_i32_le(self.lat);
30567 __tmp.put_i32_le(self.lon);
30568 __tmp.put_u16_le(self.grid_spacing);
30569 if matches!(version, MavlinkVersion::V2) {
30570 let len = __tmp.len();
30571 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30572 } else {
30573 __tmp.len()
30574 }
30575 }
30576}
30577#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
30578#[doc = ""]
30579#[doc = "ID: 111"]
30580#[derive(Debug, Clone, PartialEq)]
30581#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30582#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30583#[cfg_attr(feature = "ts", derive(TS))]
30584#[cfg_attr(feature = "ts", ts(export))]
30585pub struct TIMESYNC_DATA {
30586 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
30587 pub tc1: i64,
30588 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
30589 pub ts1: i64,
30590 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
30591 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30592 pub target_system: u8,
30593 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
30594 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30595 pub target_component: u8,
30596}
30597impl TIMESYNC_DATA {
30598 pub const ENCODED_LEN: usize = 18usize;
30599 pub const DEFAULT: Self = Self {
30600 tc1: 0_i64,
30601 ts1: 0_i64,
30602 target_system: 0_u8,
30603 target_component: 0_u8,
30604 };
30605 #[cfg(feature = "arbitrary")]
30606 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30607 use arbitrary::{Arbitrary, Unstructured};
30608 let mut buf = [0u8; 1024];
30609 rng.fill_bytes(&mut buf);
30610 let mut unstructured = Unstructured::new(&buf);
30611 Self::arbitrary(&mut unstructured).unwrap_or_default()
30612 }
30613}
30614impl Default for TIMESYNC_DATA {
30615 fn default() -> Self {
30616 Self::DEFAULT.clone()
30617 }
30618}
30619impl MessageData for TIMESYNC_DATA {
30620 type Message = MavMessage;
30621 const ID: u32 = 111u32;
30622 const NAME: &'static str = "TIMESYNC";
30623 const EXTRA_CRC: u8 = 34u8;
30624 const ENCODED_LEN: usize = 18usize;
30625 fn deser(
30626 _version: MavlinkVersion,
30627 __input: &[u8],
30628 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30629 let avail_len = __input.len();
30630 let mut payload_buf = [0; Self::ENCODED_LEN];
30631 let mut buf = if avail_len < Self::ENCODED_LEN {
30632 payload_buf[0..avail_len].copy_from_slice(__input);
30633 Bytes::new(&payload_buf)
30634 } else {
30635 Bytes::new(__input)
30636 };
30637 let mut __struct = Self::default();
30638 __struct.tc1 = buf.get_i64_le()?;
30639 __struct.ts1 = buf.get_i64_le()?;
30640 __struct.target_system = buf.get_u8()?;
30641 __struct.target_component = buf.get_u8()?;
30642 Ok(__struct)
30643 }
30644 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30645 let mut __tmp = BytesMut::new(bytes);
30646 #[allow(clippy::absurd_extreme_comparisons)]
30647 #[allow(unused_comparisons)]
30648 if __tmp.remaining() < Self::ENCODED_LEN {
30649 panic!(
30650 "buffer is too small (need {} bytes, but got {})",
30651 Self::ENCODED_LEN,
30652 __tmp.remaining(),
30653 )
30654 }
30655 __tmp.put_i64_le(self.tc1);
30656 __tmp.put_i64_le(self.ts1);
30657 if matches!(version, MavlinkVersion::V2) {
30658 __tmp.put_u8(self.target_system);
30659 __tmp.put_u8(self.target_component);
30660 let len = __tmp.len();
30661 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30662 } else {
30663 __tmp.len()
30664 }
30665 }
30666}
30667#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
30668#[doc = ""]
30669#[doc = "ID: 380"]
30670#[derive(Debug, Clone, PartialEq)]
30671#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30672#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30673#[cfg_attr(feature = "ts", derive(TS))]
30674#[cfg_attr(feature = "ts", ts(export))]
30675pub struct TIME_ESTIMATE_TO_TARGET_DATA {
30676 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
30677 pub safe_return: i32,
30678 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
30679 pub land: i32,
30680 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
30681 pub mission_next_item: i32,
30682 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
30683 pub mission_end: i32,
30684 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
30685 pub commanded_action: i32,
30686}
30687impl TIME_ESTIMATE_TO_TARGET_DATA {
30688 pub const ENCODED_LEN: usize = 20usize;
30689 pub const DEFAULT: Self = Self {
30690 safe_return: 0_i32,
30691 land: 0_i32,
30692 mission_next_item: 0_i32,
30693 mission_end: 0_i32,
30694 commanded_action: 0_i32,
30695 };
30696 #[cfg(feature = "arbitrary")]
30697 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30698 use arbitrary::{Arbitrary, Unstructured};
30699 let mut buf = [0u8; 1024];
30700 rng.fill_bytes(&mut buf);
30701 let mut unstructured = Unstructured::new(&buf);
30702 Self::arbitrary(&mut unstructured).unwrap_or_default()
30703 }
30704}
30705impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
30706 fn default() -> Self {
30707 Self::DEFAULT.clone()
30708 }
30709}
30710impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
30711 type Message = MavMessage;
30712 const ID: u32 = 380u32;
30713 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
30714 const EXTRA_CRC: u8 = 232u8;
30715 const ENCODED_LEN: usize = 20usize;
30716 fn deser(
30717 _version: MavlinkVersion,
30718 __input: &[u8],
30719 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30720 let avail_len = __input.len();
30721 let mut payload_buf = [0; Self::ENCODED_LEN];
30722 let mut buf = if avail_len < Self::ENCODED_LEN {
30723 payload_buf[0..avail_len].copy_from_slice(__input);
30724 Bytes::new(&payload_buf)
30725 } else {
30726 Bytes::new(__input)
30727 };
30728 let mut __struct = Self::default();
30729 __struct.safe_return = buf.get_i32_le()?;
30730 __struct.land = buf.get_i32_le()?;
30731 __struct.mission_next_item = buf.get_i32_le()?;
30732 __struct.mission_end = buf.get_i32_le()?;
30733 __struct.commanded_action = buf.get_i32_le()?;
30734 Ok(__struct)
30735 }
30736 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30737 let mut __tmp = BytesMut::new(bytes);
30738 #[allow(clippy::absurd_extreme_comparisons)]
30739 #[allow(unused_comparisons)]
30740 if __tmp.remaining() < Self::ENCODED_LEN {
30741 panic!(
30742 "buffer is too small (need {} bytes, but got {})",
30743 Self::ENCODED_LEN,
30744 __tmp.remaining(),
30745 )
30746 }
30747 __tmp.put_i32_le(self.safe_return);
30748 __tmp.put_i32_le(self.land);
30749 __tmp.put_i32_le(self.mission_next_item);
30750 __tmp.put_i32_le(self.mission_end);
30751 __tmp.put_i32_le(self.commanded_action);
30752 if matches!(version, MavlinkVersion::V2) {
30753 let len = __tmp.len();
30754 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30755 } else {
30756 __tmp.len()
30757 }
30758 }
30759}
30760#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
30761#[doc = ""]
30762#[doc = "ID: 333"]
30763#[derive(Debug, Clone, PartialEq)]
30764#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30765#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30766#[cfg_attr(feature = "ts", derive(TS))]
30767#[cfg_attr(feature = "ts", ts(export))]
30768pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30769 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30770 pub time_usec: u64,
30771 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
30772 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30773 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30774 pub pos_x: [f32; 5],
30775 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
30776 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30777 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30778 pub pos_y: [f32; 5],
30779 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
30780 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30781 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30782 pub pos_z: [f32; 5],
30783 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
30784 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30785 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30786 pub delta: [f32; 5],
30787 #[doc = "Yaw. Set to NaN for unchanged"]
30788 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30789 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30790 pub pos_yaw: [f32; 5],
30791 #[doc = "Number of valid control points (up-to 5 points are possible)"]
30792 pub valid_points: u8,
30793}
30794impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30795 pub const ENCODED_LEN: usize = 109usize;
30796 pub const DEFAULT: Self = Self {
30797 time_usec: 0_u64,
30798 pos_x: [0.0_f32; 5usize],
30799 pos_y: [0.0_f32; 5usize],
30800 pos_z: [0.0_f32; 5usize],
30801 delta: [0.0_f32; 5usize],
30802 pos_yaw: [0.0_f32; 5usize],
30803 valid_points: 0_u8,
30804 };
30805 #[cfg(feature = "arbitrary")]
30806 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30807 use arbitrary::{Arbitrary, Unstructured};
30808 let mut buf = [0u8; 1024];
30809 rng.fill_bytes(&mut buf);
30810 let mut unstructured = Unstructured::new(&buf);
30811 Self::arbitrary(&mut unstructured).unwrap_or_default()
30812 }
30813}
30814impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30815 fn default() -> Self {
30816 Self::DEFAULT.clone()
30817 }
30818}
30819impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
30820 type Message = MavMessage;
30821 const ID: u32 = 333u32;
30822 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
30823 const EXTRA_CRC: u8 = 231u8;
30824 const ENCODED_LEN: usize = 109usize;
30825 fn deser(
30826 _version: MavlinkVersion,
30827 __input: &[u8],
30828 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30829 let avail_len = __input.len();
30830 let mut payload_buf = [0; Self::ENCODED_LEN];
30831 let mut buf = if avail_len < Self::ENCODED_LEN {
30832 payload_buf[0..avail_len].copy_from_slice(__input);
30833 Bytes::new(&payload_buf)
30834 } else {
30835 Bytes::new(__input)
30836 };
30837 let mut __struct = Self::default();
30838 __struct.time_usec = buf.get_u64_le()?;
30839 for v in &mut __struct.pos_x {
30840 let val = buf.get_f32_le()?;
30841 *v = val;
30842 }
30843 for v in &mut __struct.pos_y {
30844 let val = buf.get_f32_le()?;
30845 *v = val;
30846 }
30847 for v in &mut __struct.pos_z {
30848 let val = buf.get_f32_le()?;
30849 *v = val;
30850 }
30851 for v in &mut __struct.delta {
30852 let val = buf.get_f32_le()?;
30853 *v = val;
30854 }
30855 for v in &mut __struct.pos_yaw {
30856 let val = buf.get_f32_le()?;
30857 *v = val;
30858 }
30859 __struct.valid_points = buf.get_u8()?;
30860 Ok(__struct)
30861 }
30862 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30863 let mut __tmp = BytesMut::new(bytes);
30864 #[allow(clippy::absurd_extreme_comparisons)]
30865 #[allow(unused_comparisons)]
30866 if __tmp.remaining() < Self::ENCODED_LEN {
30867 panic!(
30868 "buffer is too small (need {} bytes, but got {})",
30869 Self::ENCODED_LEN,
30870 __tmp.remaining(),
30871 )
30872 }
30873 __tmp.put_u64_le(self.time_usec);
30874 for val in &self.pos_x {
30875 __tmp.put_f32_le(*val);
30876 }
30877 for val in &self.pos_y {
30878 __tmp.put_f32_le(*val);
30879 }
30880 for val in &self.pos_z {
30881 __tmp.put_f32_le(*val);
30882 }
30883 for val in &self.delta {
30884 __tmp.put_f32_le(*val);
30885 }
30886 for val in &self.pos_yaw {
30887 __tmp.put_f32_le(*val);
30888 }
30889 __tmp.put_u8(self.valid_points);
30890 if matches!(version, MavlinkVersion::V2) {
30891 let len = __tmp.len();
30892 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30893 } else {
30894 __tmp.len()
30895 }
30896 }
30897}
30898#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
30899#[doc = ""]
30900#[doc = "ID: 332"]
30901#[derive(Debug, Clone, PartialEq)]
30902#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30903#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30904#[cfg_attr(feature = "ts", derive(TS))]
30905#[cfg_attr(feature = "ts", ts(export))]
30906pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30907 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30908 pub time_usec: u64,
30909 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
30910 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30911 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30912 pub pos_x: [f32; 5],
30913 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
30914 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30915 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30916 pub pos_y: [f32; 5],
30917 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
30918 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30919 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30920 pub pos_z: [f32; 5],
30921 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
30922 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30923 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30924 pub vel_x: [f32; 5],
30925 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
30926 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30927 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30928 pub vel_y: [f32; 5],
30929 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
30930 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30931 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30932 pub vel_z: [f32; 5],
30933 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
30934 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30935 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30936 pub acc_x: [f32; 5],
30937 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
30938 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30939 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30940 pub acc_y: [f32; 5],
30941 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
30942 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30943 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30944 pub acc_z: [f32; 5],
30945 #[doc = "Yaw angle, set to NaN if not being used"]
30946 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30947 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30948 pub pos_yaw: [f32; 5],
30949 #[doc = "Yaw rate, set to NaN if not being used"]
30950 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30951 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30952 pub vel_yaw: [f32; 5],
30953 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
30954 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30955 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
30956 pub command: [u16; 5],
30957 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
30958 pub valid_points: u8,
30959}
30960impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30961 pub const ENCODED_LEN: usize = 239usize;
30962 pub const DEFAULT: Self = Self {
30963 time_usec: 0_u64,
30964 pos_x: [0.0_f32; 5usize],
30965 pos_y: [0.0_f32; 5usize],
30966 pos_z: [0.0_f32; 5usize],
30967 vel_x: [0.0_f32; 5usize],
30968 vel_y: [0.0_f32; 5usize],
30969 vel_z: [0.0_f32; 5usize],
30970 acc_x: [0.0_f32; 5usize],
30971 acc_y: [0.0_f32; 5usize],
30972 acc_z: [0.0_f32; 5usize],
30973 pos_yaw: [0.0_f32; 5usize],
30974 vel_yaw: [0.0_f32; 5usize],
30975 command: [0_u16; 5usize],
30976 valid_points: 0_u8,
30977 };
30978 #[cfg(feature = "arbitrary")]
30979 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30980 use arbitrary::{Arbitrary, Unstructured};
30981 let mut buf = [0u8; 1024];
30982 rng.fill_bytes(&mut buf);
30983 let mut unstructured = Unstructured::new(&buf);
30984 Self::arbitrary(&mut unstructured).unwrap_or_default()
30985 }
30986}
30987impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30988 fn default() -> Self {
30989 Self::DEFAULT.clone()
30990 }
30991}
30992impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
30993 type Message = MavMessage;
30994 const ID: u32 = 332u32;
30995 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
30996 const EXTRA_CRC: u8 = 236u8;
30997 const ENCODED_LEN: usize = 239usize;
30998 fn deser(
30999 _version: MavlinkVersion,
31000 __input: &[u8],
31001 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31002 let avail_len = __input.len();
31003 let mut payload_buf = [0; Self::ENCODED_LEN];
31004 let mut buf = if avail_len < Self::ENCODED_LEN {
31005 payload_buf[0..avail_len].copy_from_slice(__input);
31006 Bytes::new(&payload_buf)
31007 } else {
31008 Bytes::new(__input)
31009 };
31010 let mut __struct = Self::default();
31011 __struct.time_usec = buf.get_u64_le()?;
31012 for v in &mut __struct.pos_x {
31013 let val = buf.get_f32_le()?;
31014 *v = val;
31015 }
31016 for v in &mut __struct.pos_y {
31017 let val = buf.get_f32_le()?;
31018 *v = val;
31019 }
31020 for v in &mut __struct.pos_z {
31021 let val = buf.get_f32_le()?;
31022 *v = val;
31023 }
31024 for v in &mut __struct.vel_x {
31025 let val = buf.get_f32_le()?;
31026 *v = val;
31027 }
31028 for v in &mut __struct.vel_y {
31029 let val = buf.get_f32_le()?;
31030 *v = val;
31031 }
31032 for v in &mut __struct.vel_z {
31033 let val = buf.get_f32_le()?;
31034 *v = val;
31035 }
31036 for v in &mut __struct.acc_x {
31037 let val = buf.get_f32_le()?;
31038 *v = val;
31039 }
31040 for v in &mut __struct.acc_y {
31041 let val = buf.get_f32_le()?;
31042 *v = val;
31043 }
31044 for v in &mut __struct.acc_z {
31045 let val = buf.get_f32_le()?;
31046 *v = val;
31047 }
31048 for v in &mut __struct.pos_yaw {
31049 let val = buf.get_f32_le()?;
31050 *v = val;
31051 }
31052 for v in &mut __struct.vel_yaw {
31053 let val = buf.get_f32_le()?;
31054 *v = val;
31055 }
31056 for v in &mut __struct.command {
31057 let val = buf.get_u16_le()?;
31058 *v = val;
31059 }
31060 __struct.valid_points = buf.get_u8()?;
31061 Ok(__struct)
31062 }
31063 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31064 let mut __tmp = BytesMut::new(bytes);
31065 #[allow(clippy::absurd_extreme_comparisons)]
31066 #[allow(unused_comparisons)]
31067 if __tmp.remaining() < Self::ENCODED_LEN {
31068 panic!(
31069 "buffer is too small (need {} bytes, but got {})",
31070 Self::ENCODED_LEN,
31071 __tmp.remaining(),
31072 )
31073 }
31074 __tmp.put_u64_le(self.time_usec);
31075 for val in &self.pos_x {
31076 __tmp.put_f32_le(*val);
31077 }
31078 for val in &self.pos_y {
31079 __tmp.put_f32_le(*val);
31080 }
31081 for val in &self.pos_z {
31082 __tmp.put_f32_le(*val);
31083 }
31084 for val in &self.vel_x {
31085 __tmp.put_f32_le(*val);
31086 }
31087 for val in &self.vel_y {
31088 __tmp.put_f32_le(*val);
31089 }
31090 for val in &self.vel_z {
31091 __tmp.put_f32_le(*val);
31092 }
31093 for val in &self.acc_x {
31094 __tmp.put_f32_le(*val);
31095 }
31096 for val in &self.acc_y {
31097 __tmp.put_f32_le(*val);
31098 }
31099 for val in &self.acc_z {
31100 __tmp.put_f32_le(*val);
31101 }
31102 for val in &self.pos_yaw {
31103 __tmp.put_f32_le(*val);
31104 }
31105 for val in &self.vel_yaw {
31106 __tmp.put_f32_le(*val);
31107 }
31108 for val in &self.command {
31109 __tmp.put_u16_le(*val);
31110 }
31111 __tmp.put_u8(self.valid_points);
31112 if matches!(version, MavlinkVersion::V2) {
31113 let len = __tmp.len();
31114 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31115 } else {
31116 __tmp.len()
31117 }
31118 }
31119}
31120#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
31121#[doc = ""]
31122#[doc = "ID: 385"]
31123#[derive(Debug, Clone, PartialEq)]
31124#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31125#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31126#[cfg_attr(feature = "ts", derive(TS))]
31127#[cfg_attr(feature = "ts", ts(export))]
31128pub struct TUNNEL_DATA {
31129 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
31130 pub payload_type: MavTunnelPayloadType,
31131 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
31132 pub target_system: u8,
31133 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
31134 pub target_component: u8,
31135 #[doc = "Length of the data transported in payload"]
31136 pub payload_length: u8,
31137 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
31138 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31139 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31140 pub payload: [u8; 128],
31141}
31142impl TUNNEL_DATA {
31143 pub const ENCODED_LEN: usize = 133usize;
31144 pub const DEFAULT: Self = Self {
31145 payload_type: MavTunnelPayloadType::DEFAULT,
31146 target_system: 0_u8,
31147 target_component: 0_u8,
31148 payload_length: 0_u8,
31149 payload: [0_u8; 128usize],
31150 };
31151 #[cfg(feature = "arbitrary")]
31152 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31153 use arbitrary::{Arbitrary, Unstructured};
31154 let mut buf = [0u8; 1024];
31155 rng.fill_bytes(&mut buf);
31156 let mut unstructured = Unstructured::new(&buf);
31157 Self::arbitrary(&mut unstructured).unwrap_or_default()
31158 }
31159}
31160impl Default for TUNNEL_DATA {
31161 fn default() -> Self {
31162 Self::DEFAULT.clone()
31163 }
31164}
31165impl MessageData for TUNNEL_DATA {
31166 type Message = MavMessage;
31167 const ID: u32 = 385u32;
31168 const NAME: &'static str = "TUNNEL";
31169 const EXTRA_CRC: u8 = 147u8;
31170 const ENCODED_LEN: usize = 133usize;
31171 fn deser(
31172 _version: MavlinkVersion,
31173 __input: &[u8],
31174 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31175 let avail_len = __input.len();
31176 let mut payload_buf = [0; Self::ENCODED_LEN];
31177 let mut buf = if avail_len < Self::ENCODED_LEN {
31178 payload_buf[0..avail_len].copy_from_slice(__input);
31179 Bytes::new(&payload_buf)
31180 } else {
31181 Bytes::new(__input)
31182 };
31183 let mut __struct = Self::default();
31184 let tmp = buf.get_u16_le()?;
31185 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
31186 ::mavlink_core::error::ParserError::InvalidEnum {
31187 enum_type: "MavTunnelPayloadType",
31188 value: tmp as u64,
31189 },
31190 )?;
31191 __struct.target_system = buf.get_u8()?;
31192 __struct.target_component = buf.get_u8()?;
31193 __struct.payload_length = buf.get_u8()?;
31194 for v in &mut __struct.payload {
31195 let val = buf.get_u8()?;
31196 *v = val;
31197 }
31198 Ok(__struct)
31199 }
31200 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31201 let mut __tmp = BytesMut::new(bytes);
31202 #[allow(clippy::absurd_extreme_comparisons)]
31203 #[allow(unused_comparisons)]
31204 if __tmp.remaining() < Self::ENCODED_LEN {
31205 panic!(
31206 "buffer is too small (need {} bytes, but got {})",
31207 Self::ENCODED_LEN,
31208 __tmp.remaining(),
31209 )
31210 }
31211 __tmp.put_u16_le(self.payload_type as u16);
31212 __tmp.put_u8(self.target_system);
31213 __tmp.put_u8(self.target_component);
31214 __tmp.put_u8(self.payload_length);
31215 for val in &self.payload {
31216 __tmp.put_u8(*val);
31217 }
31218 if matches!(version, MavlinkVersion::V2) {
31219 let len = __tmp.len();
31220 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31221 } else {
31222 __tmp.len()
31223 }
31224 }
31225}
31226#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
31227#[doc = ""]
31228#[doc = "ID: 311"]
31229#[derive(Debug, Clone, PartialEq)]
31230#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31231#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31232#[cfg_attr(feature = "ts", derive(TS))]
31233#[cfg_attr(feature = "ts", ts(export))]
31234pub struct UAVCAN_NODE_INFO_DATA {
31235 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31236 pub time_usec: u64,
31237 #[doc = "Time since the start-up of the node."]
31238 pub uptime_sec: u32,
31239 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
31240 pub sw_vcs_commit: u32,
31241 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
31242 #[cfg_attr(feature = "ts", ts(type = "string"))]
31243 pub name: CharArray<80>,
31244 #[doc = "Hardware major version number."]
31245 pub hw_version_major: u8,
31246 #[doc = "Hardware minor version number."]
31247 pub hw_version_minor: u8,
31248 #[doc = "Hardware unique 128-bit ID."]
31249 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31250 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31251 pub hw_unique_id: [u8; 16],
31252 #[doc = "Software major version number."]
31253 pub sw_version_major: u8,
31254 #[doc = "Software minor version number."]
31255 pub sw_version_minor: u8,
31256}
31257impl UAVCAN_NODE_INFO_DATA {
31258 pub const ENCODED_LEN: usize = 116usize;
31259 pub const DEFAULT: Self = Self {
31260 time_usec: 0_u64,
31261 uptime_sec: 0_u32,
31262 sw_vcs_commit: 0_u32,
31263 name: CharArray::new([0_u8; 80usize]),
31264 hw_version_major: 0_u8,
31265 hw_version_minor: 0_u8,
31266 hw_unique_id: [0_u8; 16usize],
31267 sw_version_major: 0_u8,
31268 sw_version_minor: 0_u8,
31269 };
31270 #[cfg(feature = "arbitrary")]
31271 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31272 use arbitrary::{Arbitrary, Unstructured};
31273 let mut buf = [0u8; 1024];
31274 rng.fill_bytes(&mut buf);
31275 let mut unstructured = Unstructured::new(&buf);
31276 Self::arbitrary(&mut unstructured).unwrap_or_default()
31277 }
31278}
31279impl Default for UAVCAN_NODE_INFO_DATA {
31280 fn default() -> Self {
31281 Self::DEFAULT.clone()
31282 }
31283}
31284impl MessageData for UAVCAN_NODE_INFO_DATA {
31285 type Message = MavMessage;
31286 const ID: u32 = 311u32;
31287 const NAME: &'static str = "UAVCAN_NODE_INFO";
31288 const EXTRA_CRC: u8 = 95u8;
31289 const ENCODED_LEN: usize = 116usize;
31290 fn deser(
31291 _version: MavlinkVersion,
31292 __input: &[u8],
31293 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31294 let avail_len = __input.len();
31295 let mut payload_buf = [0; Self::ENCODED_LEN];
31296 let mut buf = if avail_len < Self::ENCODED_LEN {
31297 payload_buf[0..avail_len].copy_from_slice(__input);
31298 Bytes::new(&payload_buf)
31299 } else {
31300 Bytes::new(__input)
31301 };
31302 let mut __struct = Self::default();
31303 __struct.time_usec = buf.get_u64_le()?;
31304 __struct.uptime_sec = buf.get_u32_le()?;
31305 __struct.sw_vcs_commit = buf.get_u32_le()?;
31306 let mut tmp = [0_u8; 80usize];
31307 for v in &mut tmp {
31308 *v = buf.get_u8()?;
31309 }
31310 __struct.name = CharArray::new(tmp);
31311 __struct.hw_version_major = buf.get_u8()?;
31312 __struct.hw_version_minor = buf.get_u8()?;
31313 for v in &mut __struct.hw_unique_id {
31314 let val = buf.get_u8()?;
31315 *v = val;
31316 }
31317 __struct.sw_version_major = buf.get_u8()?;
31318 __struct.sw_version_minor = buf.get_u8()?;
31319 Ok(__struct)
31320 }
31321 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31322 let mut __tmp = BytesMut::new(bytes);
31323 #[allow(clippy::absurd_extreme_comparisons)]
31324 #[allow(unused_comparisons)]
31325 if __tmp.remaining() < Self::ENCODED_LEN {
31326 panic!(
31327 "buffer is too small (need {} bytes, but got {})",
31328 Self::ENCODED_LEN,
31329 __tmp.remaining(),
31330 )
31331 }
31332 __tmp.put_u64_le(self.time_usec);
31333 __tmp.put_u32_le(self.uptime_sec);
31334 __tmp.put_u32_le(self.sw_vcs_commit);
31335 for val in &self.name {
31336 __tmp.put_u8(*val);
31337 }
31338 __tmp.put_u8(self.hw_version_major);
31339 __tmp.put_u8(self.hw_version_minor);
31340 for val in &self.hw_unique_id {
31341 __tmp.put_u8(*val);
31342 }
31343 __tmp.put_u8(self.sw_version_major);
31344 __tmp.put_u8(self.sw_version_minor);
31345 if matches!(version, MavlinkVersion::V2) {
31346 let len = __tmp.len();
31347 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31348 } else {
31349 __tmp.len()
31350 }
31351 }
31352}
31353#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
31354#[doc = ""]
31355#[doc = "ID: 310"]
31356#[derive(Debug, Clone, PartialEq)]
31357#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31358#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31359#[cfg_attr(feature = "ts", derive(TS))]
31360#[cfg_attr(feature = "ts", ts(export))]
31361pub struct UAVCAN_NODE_STATUS_DATA {
31362 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31363 pub time_usec: u64,
31364 #[doc = "Time since the start-up of the node."]
31365 pub uptime_sec: u32,
31366 #[doc = "Vendor-specific status information."]
31367 pub vendor_specific_status_code: u16,
31368 #[doc = "Generalized node health status."]
31369 pub health: UavcanNodeHealth,
31370 #[doc = "Generalized operating mode."]
31371 pub mode: UavcanNodeMode,
31372 #[doc = "Not used currently."]
31373 pub sub_mode: u8,
31374}
31375impl UAVCAN_NODE_STATUS_DATA {
31376 pub const ENCODED_LEN: usize = 17usize;
31377 pub const DEFAULT: Self = Self {
31378 time_usec: 0_u64,
31379 uptime_sec: 0_u32,
31380 vendor_specific_status_code: 0_u16,
31381 health: UavcanNodeHealth::DEFAULT,
31382 mode: UavcanNodeMode::DEFAULT,
31383 sub_mode: 0_u8,
31384 };
31385 #[cfg(feature = "arbitrary")]
31386 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31387 use arbitrary::{Arbitrary, Unstructured};
31388 let mut buf = [0u8; 1024];
31389 rng.fill_bytes(&mut buf);
31390 let mut unstructured = Unstructured::new(&buf);
31391 Self::arbitrary(&mut unstructured).unwrap_or_default()
31392 }
31393}
31394impl Default for UAVCAN_NODE_STATUS_DATA {
31395 fn default() -> Self {
31396 Self::DEFAULT.clone()
31397 }
31398}
31399impl MessageData for UAVCAN_NODE_STATUS_DATA {
31400 type Message = MavMessage;
31401 const ID: u32 = 310u32;
31402 const NAME: &'static str = "UAVCAN_NODE_STATUS";
31403 const EXTRA_CRC: u8 = 28u8;
31404 const ENCODED_LEN: usize = 17usize;
31405 fn deser(
31406 _version: MavlinkVersion,
31407 __input: &[u8],
31408 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31409 let avail_len = __input.len();
31410 let mut payload_buf = [0; Self::ENCODED_LEN];
31411 let mut buf = if avail_len < Self::ENCODED_LEN {
31412 payload_buf[0..avail_len].copy_from_slice(__input);
31413 Bytes::new(&payload_buf)
31414 } else {
31415 Bytes::new(__input)
31416 };
31417 let mut __struct = Self::default();
31418 __struct.time_usec = buf.get_u64_le()?;
31419 __struct.uptime_sec = buf.get_u32_le()?;
31420 __struct.vendor_specific_status_code = buf.get_u16_le()?;
31421 let tmp = buf.get_u8()?;
31422 __struct.health =
31423 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31424 enum_type: "UavcanNodeHealth",
31425 value: tmp as u64,
31426 })?;
31427 let tmp = buf.get_u8()?;
31428 __struct.mode =
31429 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31430 enum_type: "UavcanNodeMode",
31431 value: tmp as u64,
31432 })?;
31433 __struct.sub_mode = buf.get_u8()?;
31434 Ok(__struct)
31435 }
31436 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31437 let mut __tmp = BytesMut::new(bytes);
31438 #[allow(clippy::absurd_extreme_comparisons)]
31439 #[allow(unused_comparisons)]
31440 if __tmp.remaining() < Self::ENCODED_LEN {
31441 panic!(
31442 "buffer is too small (need {} bytes, but got {})",
31443 Self::ENCODED_LEN,
31444 __tmp.remaining(),
31445 )
31446 }
31447 __tmp.put_u64_le(self.time_usec);
31448 __tmp.put_u32_le(self.uptime_sec);
31449 __tmp.put_u16_le(self.vendor_specific_status_code);
31450 __tmp.put_u8(self.health as u8);
31451 __tmp.put_u8(self.mode as u8);
31452 __tmp.put_u8(self.sub_mode);
31453 if matches!(version, MavlinkVersion::V2) {
31454 let len = __tmp.len();
31455 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31456 } else {
31457 __tmp.len()
31458 }
31459 }
31460}
31461#[doc = "The global position resulting from GPS and sensor fusion."]
31462#[doc = ""]
31463#[doc = "ID: 340"]
31464#[derive(Debug, Clone, PartialEq)]
31465#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31466#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31467#[cfg_attr(feature = "ts", derive(TS))]
31468#[cfg_attr(feature = "ts", ts(export))]
31469pub struct UTM_GLOBAL_POSITION_DATA {
31470 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
31471 pub time: u64,
31472 #[doc = "Latitude (WGS84)"]
31473 pub lat: i32,
31474 #[doc = "Longitude (WGS84)"]
31475 pub lon: i32,
31476 #[doc = "Altitude (WGS84)"]
31477 pub alt: i32,
31478 #[doc = "Altitude above ground"]
31479 pub relative_alt: i32,
31480 #[doc = "Next waypoint, latitude (WGS84)"]
31481 pub next_lat: i32,
31482 #[doc = "Next waypoint, longitude (WGS84)"]
31483 pub next_lon: i32,
31484 #[doc = "Next waypoint, altitude (WGS84)"]
31485 pub next_alt: i32,
31486 #[doc = "Ground X speed (latitude, positive north)"]
31487 pub vx: i16,
31488 #[doc = "Ground Y speed (longitude, positive east)"]
31489 pub vy: i16,
31490 #[doc = "Ground Z speed (altitude, positive down)"]
31491 pub vz: i16,
31492 #[doc = "Horizontal position uncertainty (standard deviation)"]
31493 pub h_acc: u16,
31494 #[doc = "Altitude uncertainty (standard deviation)"]
31495 pub v_acc: u16,
31496 #[doc = "Speed uncertainty (standard deviation)"]
31497 pub vel_acc: u16,
31498 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
31499 pub update_rate: u16,
31500 #[doc = "Unique UAS ID."]
31501 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31502 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31503 pub uas_id: [u8; 18],
31504 #[doc = "Flight state"]
31505 pub flight_state: UtmFlightState,
31506 #[doc = "Bitwise OR combination of the data available flags."]
31507 pub flags: UtmDataAvailFlags,
31508}
31509impl UTM_GLOBAL_POSITION_DATA {
31510 pub const ENCODED_LEN: usize = 70usize;
31511 pub const DEFAULT: Self = Self {
31512 time: 0_u64,
31513 lat: 0_i32,
31514 lon: 0_i32,
31515 alt: 0_i32,
31516 relative_alt: 0_i32,
31517 next_lat: 0_i32,
31518 next_lon: 0_i32,
31519 next_alt: 0_i32,
31520 vx: 0_i16,
31521 vy: 0_i16,
31522 vz: 0_i16,
31523 h_acc: 0_u16,
31524 v_acc: 0_u16,
31525 vel_acc: 0_u16,
31526 update_rate: 0_u16,
31527 uas_id: [0_u8; 18usize],
31528 flight_state: UtmFlightState::DEFAULT,
31529 flags: UtmDataAvailFlags::DEFAULT,
31530 };
31531 #[cfg(feature = "arbitrary")]
31532 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31533 use arbitrary::{Arbitrary, Unstructured};
31534 let mut buf = [0u8; 1024];
31535 rng.fill_bytes(&mut buf);
31536 let mut unstructured = Unstructured::new(&buf);
31537 Self::arbitrary(&mut unstructured).unwrap_or_default()
31538 }
31539}
31540impl Default for UTM_GLOBAL_POSITION_DATA {
31541 fn default() -> Self {
31542 Self::DEFAULT.clone()
31543 }
31544}
31545impl MessageData for UTM_GLOBAL_POSITION_DATA {
31546 type Message = MavMessage;
31547 const ID: u32 = 340u32;
31548 const NAME: &'static str = "UTM_GLOBAL_POSITION";
31549 const EXTRA_CRC: u8 = 99u8;
31550 const ENCODED_LEN: usize = 70usize;
31551 fn deser(
31552 _version: MavlinkVersion,
31553 __input: &[u8],
31554 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31555 let avail_len = __input.len();
31556 let mut payload_buf = [0; Self::ENCODED_LEN];
31557 let mut buf = if avail_len < Self::ENCODED_LEN {
31558 payload_buf[0..avail_len].copy_from_slice(__input);
31559 Bytes::new(&payload_buf)
31560 } else {
31561 Bytes::new(__input)
31562 };
31563 let mut __struct = Self::default();
31564 __struct.time = buf.get_u64_le()?;
31565 __struct.lat = buf.get_i32_le()?;
31566 __struct.lon = buf.get_i32_le()?;
31567 __struct.alt = buf.get_i32_le()?;
31568 __struct.relative_alt = buf.get_i32_le()?;
31569 __struct.next_lat = buf.get_i32_le()?;
31570 __struct.next_lon = buf.get_i32_le()?;
31571 __struct.next_alt = buf.get_i32_le()?;
31572 __struct.vx = buf.get_i16_le()?;
31573 __struct.vy = buf.get_i16_le()?;
31574 __struct.vz = buf.get_i16_le()?;
31575 __struct.h_acc = buf.get_u16_le()?;
31576 __struct.v_acc = buf.get_u16_le()?;
31577 __struct.vel_acc = buf.get_u16_le()?;
31578 __struct.update_rate = buf.get_u16_le()?;
31579 for v in &mut __struct.uas_id {
31580 let val = buf.get_u8()?;
31581 *v = val;
31582 }
31583 let tmp = buf.get_u8()?;
31584 __struct.flight_state =
31585 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31586 enum_type: "UtmFlightState",
31587 value: tmp as u64,
31588 })?;
31589 let tmp = buf.get_u8()?;
31590 __struct.flags = UtmDataAvailFlags::from_bits(tmp as <UtmDataAvailFlags as Flags>::Bits)
31591 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31592 flag_type: "UtmDataAvailFlags",
31593 value: tmp as u64,
31594 })?;
31595 Ok(__struct)
31596 }
31597 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31598 let mut __tmp = BytesMut::new(bytes);
31599 #[allow(clippy::absurd_extreme_comparisons)]
31600 #[allow(unused_comparisons)]
31601 if __tmp.remaining() < Self::ENCODED_LEN {
31602 panic!(
31603 "buffer is too small (need {} bytes, but got {})",
31604 Self::ENCODED_LEN,
31605 __tmp.remaining(),
31606 )
31607 }
31608 __tmp.put_u64_le(self.time);
31609 __tmp.put_i32_le(self.lat);
31610 __tmp.put_i32_le(self.lon);
31611 __tmp.put_i32_le(self.alt);
31612 __tmp.put_i32_le(self.relative_alt);
31613 __tmp.put_i32_le(self.next_lat);
31614 __tmp.put_i32_le(self.next_lon);
31615 __tmp.put_i32_le(self.next_alt);
31616 __tmp.put_i16_le(self.vx);
31617 __tmp.put_i16_le(self.vy);
31618 __tmp.put_i16_le(self.vz);
31619 __tmp.put_u16_le(self.h_acc);
31620 __tmp.put_u16_le(self.v_acc);
31621 __tmp.put_u16_le(self.vel_acc);
31622 __tmp.put_u16_le(self.update_rate);
31623 for val in &self.uas_id {
31624 __tmp.put_u8(*val);
31625 }
31626 __tmp.put_u8(self.flight_state as u8);
31627 __tmp.put_u8(self.flags.bits() as u8);
31628 if matches!(version, MavlinkVersion::V2) {
31629 let len = __tmp.len();
31630 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31631 } else {
31632 __tmp.len()
31633 }
31634 }
31635}
31636#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
31637#[doc = ""]
31638#[doc = "ID: 248"]
31639#[derive(Debug, Clone, PartialEq)]
31640#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31641#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31642#[cfg_attr(feature = "ts", derive(TS))]
31643#[cfg_attr(feature = "ts", ts(export))]
31644pub struct V2_EXTENSION_DATA {
31645 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
31646 pub message_type: u16,
31647 #[doc = "Network ID (0 for broadcast)"]
31648 pub target_network: u8,
31649 #[doc = "System ID (0 for broadcast)"]
31650 pub target_system: u8,
31651 #[doc = "Component ID (0 for broadcast)"]
31652 pub target_component: u8,
31653 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
31654 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31655 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31656 pub payload: [u8; 249],
31657}
31658impl V2_EXTENSION_DATA {
31659 pub const ENCODED_LEN: usize = 254usize;
31660 pub const DEFAULT: Self = Self {
31661 message_type: 0_u16,
31662 target_network: 0_u8,
31663 target_system: 0_u8,
31664 target_component: 0_u8,
31665 payload: [0_u8; 249usize],
31666 };
31667 #[cfg(feature = "arbitrary")]
31668 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31669 use arbitrary::{Arbitrary, Unstructured};
31670 let mut buf = [0u8; 1024];
31671 rng.fill_bytes(&mut buf);
31672 let mut unstructured = Unstructured::new(&buf);
31673 Self::arbitrary(&mut unstructured).unwrap_or_default()
31674 }
31675}
31676impl Default for V2_EXTENSION_DATA {
31677 fn default() -> Self {
31678 Self::DEFAULT.clone()
31679 }
31680}
31681impl MessageData for V2_EXTENSION_DATA {
31682 type Message = MavMessage;
31683 const ID: u32 = 248u32;
31684 const NAME: &'static str = "V2_EXTENSION";
31685 const EXTRA_CRC: u8 = 8u8;
31686 const ENCODED_LEN: usize = 254usize;
31687 fn deser(
31688 _version: MavlinkVersion,
31689 __input: &[u8],
31690 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31691 let avail_len = __input.len();
31692 let mut payload_buf = [0; Self::ENCODED_LEN];
31693 let mut buf = if avail_len < Self::ENCODED_LEN {
31694 payload_buf[0..avail_len].copy_from_slice(__input);
31695 Bytes::new(&payload_buf)
31696 } else {
31697 Bytes::new(__input)
31698 };
31699 let mut __struct = Self::default();
31700 __struct.message_type = buf.get_u16_le()?;
31701 __struct.target_network = buf.get_u8()?;
31702 __struct.target_system = buf.get_u8()?;
31703 __struct.target_component = buf.get_u8()?;
31704 for v in &mut __struct.payload {
31705 let val = buf.get_u8()?;
31706 *v = val;
31707 }
31708 Ok(__struct)
31709 }
31710 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31711 let mut __tmp = BytesMut::new(bytes);
31712 #[allow(clippy::absurd_extreme_comparisons)]
31713 #[allow(unused_comparisons)]
31714 if __tmp.remaining() < Self::ENCODED_LEN {
31715 panic!(
31716 "buffer is too small (need {} bytes, but got {})",
31717 Self::ENCODED_LEN,
31718 __tmp.remaining(),
31719 )
31720 }
31721 __tmp.put_u16_le(self.message_type);
31722 __tmp.put_u8(self.target_network);
31723 __tmp.put_u8(self.target_system);
31724 __tmp.put_u8(self.target_component);
31725 for val in &self.payload {
31726 __tmp.put_u8(*val);
31727 }
31728 if matches!(version, MavlinkVersion::V2) {
31729 let len = __tmp.len();
31730 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31731 } else {
31732 __tmp.len()
31733 }
31734 }
31735}
31736#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
31737#[doc = ""]
31738#[doc = "ID: 74"]
31739#[derive(Debug, Clone, PartialEq)]
31740#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31741#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31742#[cfg_attr(feature = "ts", derive(TS))]
31743#[cfg_attr(feature = "ts", ts(export))]
31744pub struct VFR_HUD_DATA {
31745 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
31746 pub airspeed: f32,
31747 #[doc = "Current ground speed."]
31748 pub groundspeed: f32,
31749 #[doc = "Current altitude (MSL)."]
31750 pub alt: f32,
31751 #[doc = "Current climb rate."]
31752 pub climb: f32,
31753 #[doc = "Current heading in compass units (0-360, 0=north)."]
31754 pub heading: i16,
31755 #[doc = "Current throttle setting (0 to 100)."]
31756 pub throttle: u16,
31757}
31758impl VFR_HUD_DATA {
31759 pub const ENCODED_LEN: usize = 20usize;
31760 pub const DEFAULT: Self = Self {
31761 airspeed: 0.0_f32,
31762 groundspeed: 0.0_f32,
31763 alt: 0.0_f32,
31764 climb: 0.0_f32,
31765 heading: 0_i16,
31766 throttle: 0_u16,
31767 };
31768 #[cfg(feature = "arbitrary")]
31769 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31770 use arbitrary::{Arbitrary, Unstructured};
31771 let mut buf = [0u8; 1024];
31772 rng.fill_bytes(&mut buf);
31773 let mut unstructured = Unstructured::new(&buf);
31774 Self::arbitrary(&mut unstructured).unwrap_or_default()
31775 }
31776}
31777impl Default for VFR_HUD_DATA {
31778 fn default() -> Self {
31779 Self::DEFAULT.clone()
31780 }
31781}
31782impl MessageData for VFR_HUD_DATA {
31783 type Message = MavMessage;
31784 const ID: u32 = 74u32;
31785 const NAME: &'static str = "VFR_HUD";
31786 const EXTRA_CRC: u8 = 20u8;
31787 const ENCODED_LEN: usize = 20usize;
31788 fn deser(
31789 _version: MavlinkVersion,
31790 __input: &[u8],
31791 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31792 let avail_len = __input.len();
31793 let mut payload_buf = [0; Self::ENCODED_LEN];
31794 let mut buf = if avail_len < Self::ENCODED_LEN {
31795 payload_buf[0..avail_len].copy_from_slice(__input);
31796 Bytes::new(&payload_buf)
31797 } else {
31798 Bytes::new(__input)
31799 };
31800 let mut __struct = Self::default();
31801 __struct.airspeed = buf.get_f32_le()?;
31802 __struct.groundspeed = buf.get_f32_le()?;
31803 __struct.alt = buf.get_f32_le()?;
31804 __struct.climb = buf.get_f32_le()?;
31805 __struct.heading = buf.get_i16_le()?;
31806 __struct.throttle = buf.get_u16_le()?;
31807 Ok(__struct)
31808 }
31809 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31810 let mut __tmp = BytesMut::new(bytes);
31811 #[allow(clippy::absurd_extreme_comparisons)]
31812 #[allow(unused_comparisons)]
31813 if __tmp.remaining() < Self::ENCODED_LEN {
31814 panic!(
31815 "buffer is too small (need {} bytes, but got {})",
31816 Self::ENCODED_LEN,
31817 __tmp.remaining(),
31818 )
31819 }
31820 __tmp.put_f32_le(self.airspeed);
31821 __tmp.put_f32_le(self.groundspeed);
31822 __tmp.put_f32_le(self.alt);
31823 __tmp.put_f32_le(self.climb);
31824 __tmp.put_i16_le(self.heading);
31825 __tmp.put_u16_le(self.throttle);
31826 if matches!(version, MavlinkVersion::V2) {
31827 let len = __tmp.len();
31828 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31829 } else {
31830 __tmp.len()
31831 }
31832 }
31833}
31834#[doc = "Vibration levels and accelerometer clipping."]
31835#[doc = ""]
31836#[doc = "ID: 241"]
31837#[derive(Debug, Clone, PartialEq)]
31838#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31839#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31840#[cfg_attr(feature = "ts", derive(TS))]
31841#[cfg_attr(feature = "ts", ts(export))]
31842pub struct VIBRATION_DATA {
31843 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31844 pub time_usec: u64,
31845 #[doc = "Vibration levels on X-axis"]
31846 pub vibration_x: f32,
31847 #[doc = "Vibration levels on Y-axis"]
31848 pub vibration_y: f32,
31849 #[doc = "Vibration levels on Z-axis"]
31850 pub vibration_z: f32,
31851 #[doc = "first accelerometer clipping count"]
31852 pub clipping_0: u32,
31853 #[doc = "second accelerometer clipping count"]
31854 pub clipping_1: u32,
31855 #[doc = "third accelerometer clipping count"]
31856 pub clipping_2: u32,
31857}
31858impl VIBRATION_DATA {
31859 pub const ENCODED_LEN: usize = 32usize;
31860 pub const DEFAULT: Self = Self {
31861 time_usec: 0_u64,
31862 vibration_x: 0.0_f32,
31863 vibration_y: 0.0_f32,
31864 vibration_z: 0.0_f32,
31865 clipping_0: 0_u32,
31866 clipping_1: 0_u32,
31867 clipping_2: 0_u32,
31868 };
31869 #[cfg(feature = "arbitrary")]
31870 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31871 use arbitrary::{Arbitrary, Unstructured};
31872 let mut buf = [0u8; 1024];
31873 rng.fill_bytes(&mut buf);
31874 let mut unstructured = Unstructured::new(&buf);
31875 Self::arbitrary(&mut unstructured).unwrap_or_default()
31876 }
31877}
31878impl Default for VIBRATION_DATA {
31879 fn default() -> Self {
31880 Self::DEFAULT.clone()
31881 }
31882}
31883impl MessageData for VIBRATION_DATA {
31884 type Message = MavMessage;
31885 const ID: u32 = 241u32;
31886 const NAME: &'static str = "VIBRATION";
31887 const EXTRA_CRC: u8 = 90u8;
31888 const ENCODED_LEN: usize = 32usize;
31889 fn deser(
31890 _version: MavlinkVersion,
31891 __input: &[u8],
31892 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31893 let avail_len = __input.len();
31894 let mut payload_buf = [0; Self::ENCODED_LEN];
31895 let mut buf = if avail_len < Self::ENCODED_LEN {
31896 payload_buf[0..avail_len].copy_from_slice(__input);
31897 Bytes::new(&payload_buf)
31898 } else {
31899 Bytes::new(__input)
31900 };
31901 let mut __struct = Self::default();
31902 __struct.time_usec = buf.get_u64_le()?;
31903 __struct.vibration_x = buf.get_f32_le()?;
31904 __struct.vibration_y = buf.get_f32_le()?;
31905 __struct.vibration_z = buf.get_f32_le()?;
31906 __struct.clipping_0 = buf.get_u32_le()?;
31907 __struct.clipping_1 = buf.get_u32_le()?;
31908 __struct.clipping_2 = buf.get_u32_le()?;
31909 Ok(__struct)
31910 }
31911 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31912 let mut __tmp = BytesMut::new(bytes);
31913 #[allow(clippy::absurd_extreme_comparisons)]
31914 #[allow(unused_comparisons)]
31915 if __tmp.remaining() < Self::ENCODED_LEN {
31916 panic!(
31917 "buffer is too small (need {} bytes, but got {})",
31918 Self::ENCODED_LEN,
31919 __tmp.remaining(),
31920 )
31921 }
31922 __tmp.put_u64_le(self.time_usec);
31923 __tmp.put_f32_le(self.vibration_x);
31924 __tmp.put_f32_le(self.vibration_y);
31925 __tmp.put_f32_le(self.vibration_z);
31926 __tmp.put_u32_le(self.clipping_0);
31927 __tmp.put_u32_le(self.clipping_1);
31928 __tmp.put_u32_le(self.clipping_2);
31929 if matches!(version, MavlinkVersion::V2) {
31930 let len = __tmp.len();
31931 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31932 } else {
31933 __tmp.len()
31934 }
31935 }
31936}
31937#[doc = "Global position estimate from a Vicon motion system source."]
31938#[doc = ""]
31939#[doc = "ID: 104"]
31940#[derive(Debug, Clone, PartialEq)]
31941#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31942#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31943#[cfg_attr(feature = "ts", derive(TS))]
31944#[cfg_attr(feature = "ts", ts(export))]
31945pub struct VICON_POSITION_ESTIMATE_DATA {
31946 #[doc = "Timestamp (UNIX time or time since system boot)"]
31947 pub usec: u64,
31948 #[doc = "Global X position"]
31949 pub x: f32,
31950 #[doc = "Global Y position"]
31951 pub y: f32,
31952 #[doc = "Global Z position"]
31953 pub z: f32,
31954 #[doc = "Roll angle"]
31955 pub roll: f32,
31956 #[doc = "Pitch angle"]
31957 pub pitch: f32,
31958 #[doc = "Yaw angle"]
31959 pub yaw: f32,
31960 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31961 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31962 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31963 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
31964 pub covariance: [f32; 21],
31965}
31966impl VICON_POSITION_ESTIMATE_DATA {
31967 pub const ENCODED_LEN: usize = 116usize;
31968 pub const DEFAULT: Self = Self {
31969 usec: 0_u64,
31970 x: 0.0_f32,
31971 y: 0.0_f32,
31972 z: 0.0_f32,
31973 roll: 0.0_f32,
31974 pitch: 0.0_f32,
31975 yaw: 0.0_f32,
31976 covariance: [0.0_f32; 21usize],
31977 };
31978 #[cfg(feature = "arbitrary")]
31979 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31980 use arbitrary::{Arbitrary, Unstructured};
31981 let mut buf = [0u8; 1024];
31982 rng.fill_bytes(&mut buf);
31983 let mut unstructured = Unstructured::new(&buf);
31984 Self::arbitrary(&mut unstructured).unwrap_or_default()
31985 }
31986}
31987impl Default for VICON_POSITION_ESTIMATE_DATA {
31988 fn default() -> Self {
31989 Self::DEFAULT.clone()
31990 }
31991}
31992impl MessageData for VICON_POSITION_ESTIMATE_DATA {
31993 type Message = MavMessage;
31994 const ID: u32 = 104u32;
31995 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
31996 const EXTRA_CRC: u8 = 56u8;
31997 const ENCODED_LEN: usize = 116usize;
31998 fn deser(
31999 _version: MavlinkVersion,
32000 __input: &[u8],
32001 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32002 let avail_len = __input.len();
32003 let mut payload_buf = [0; Self::ENCODED_LEN];
32004 let mut buf = if avail_len < Self::ENCODED_LEN {
32005 payload_buf[0..avail_len].copy_from_slice(__input);
32006 Bytes::new(&payload_buf)
32007 } else {
32008 Bytes::new(__input)
32009 };
32010 let mut __struct = Self::default();
32011 __struct.usec = buf.get_u64_le()?;
32012 __struct.x = buf.get_f32_le()?;
32013 __struct.y = buf.get_f32_le()?;
32014 __struct.z = buf.get_f32_le()?;
32015 __struct.roll = buf.get_f32_le()?;
32016 __struct.pitch = buf.get_f32_le()?;
32017 __struct.yaw = buf.get_f32_le()?;
32018 for v in &mut __struct.covariance {
32019 let val = buf.get_f32_le()?;
32020 *v = val;
32021 }
32022 Ok(__struct)
32023 }
32024 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32025 let mut __tmp = BytesMut::new(bytes);
32026 #[allow(clippy::absurd_extreme_comparisons)]
32027 #[allow(unused_comparisons)]
32028 if __tmp.remaining() < Self::ENCODED_LEN {
32029 panic!(
32030 "buffer is too small (need {} bytes, but got {})",
32031 Self::ENCODED_LEN,
32032 __tmp.remaining(),
32033 )
32034 }
32035 __tmp.put_u64_le(self.usec);
32036 __tmp.put_f32_le(self.x);
32037 __tmp.put_f32_le(self.y);
32038 __tmp.put_f32_le(self.z);
32039 __tmp.put_f32_le(self.roll);
32040 __tmp.put_f32_le(self.pitch);
32041 __tmp.put_f32_le(self.yaw);
32042 if matches!(version, MavlinkVersion::V2) {
32043 for val in &self.covariance {
32044 __tmp.put_f32_le(*val);
32045 }
32046 let len = __tmp.len();
32047 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32048 } else {
32049 __tmp.len()
32050 }
32051 }
32052}
32053#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
32054#[doc = ""]
32055#[doc = "ID: 269"]
32056#[derive(Debug, Clone, PartialEq)]
32057#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32058#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32059#[cfg_attr(feature = "ts", derive(TS))]
32060#[cfg_attr(feature = "ts", ts(export))]
32061pub struct VIDEO_STREAM_INFORMATION_DATA {
32062 #[doc = "Frame rate."]
32063 pub framerate: f32,
32064 #[doc = "Bit rate."]
32065 pub bitrate: u32,
32066 #[doc = "Bitmap of stream status flags."]
32067 pub flags: VideoStreamStatusFlags,
32068 #[doc = "Horizontal resolution."]
32069 pub resolution_h: u16,
32070 #[doc = "Vertical resolution."]
32071 pub resolution_v: u16,
32072 #[doc = "Video image rotation clockwise."]
32073 pub rotation: u16,
32074 #[doc = "Horizontal Field of view."]
32075 pub hfov: u16,
32076 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
32077 pub stream_id: u8,
32078 #[doc = "Number of streams available."]
32079 pub count: u8,
32080 #[doc = "Type of stream."]
32081 pub mavtype: VideoStreamType,
32082 #[doc = "Stream name."]
32083 #[cfg_attr(feature = "ts", ts(type = "string"))]
32084 pub name: CharArray<32>,
32085 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
32086 #[cfg_attr(feature = "ts", ts(type = "string"))]
32087 pub uri: CharArray<160>,
32088 #[doc = "Encoding of stream."]
32089 #[cfg_attr(feature = "serde", serde(default))]
32090 pub encoding: VideoStreamEncoding,
32091 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
32092 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32093 pub camera_device_id: u8,
32094}
32095impl VIDEO_STREAM_INFORMATION_DATA {
32096 pub const ENCODED_LEN: usize = 215usize;
32097 pub const DEFAULT: Self = Self {
32098 framerate: 0.0_f32,
32099 bitrate: 0_u32,
32100 flags: VideoStreamStatusFlags::DEFAULT,
32101 resolution_h: 0_u16,
32102 resolution_v: 0_u16,
32103 rotation: 0_u16,
32104 hfov: 0_u16,
32105 stream_id: 0_u8,
32106 count: 0_u8,
32107 mavtype: VideoStreamType::DEFAULT,
32108 name: CharArray::new([0_u8; 32usize]),
32109 uri: CharArray::new([0_u8; 160usize]),
32110 encoding: VideoStreamEncoding::DEFAULT,
32111 camera_device_id: 0_u8,
32112 };
32113 #[cfg(feature = "arbitrary")]
32114 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32115 use arbitrary::{Arbitrary, Unstructured};
32116 let mut buf = [0u8; 1024];
32117 rng.fill_bytes(&mut buf);
32118 let mut unstructured = Unstructured::new(&buf);
32119 Self::arbitrary(&mut unstructured).unwrap_or_default()
32120 }
32121}
32122impl Default for VIDEO_STREAM_INFORMATION_DATA {
32123 fn default() -> Self {
32124 Self::DEFAULT.clone()
32125 }
32126}
32127impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
32128 type Message = MavMessage;
32129 const ID: u32 = 269u32;
32130 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
32131 const EXTRA_CRC: u8 = 109u8;
32132 const ENCODED_LEN: usize = 215usize;
32133 fn deser(
32134 _version: MavlinkVersion,
32135 __input: &[u8],
32136 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32137 let avail_len = __input.len();
32138 let mut payload_buf = [0; Self::ENCODED_LEN];
32139 let mut buf = if avail_len < Self::ENCODED_LEN {
32140 payload_buf[0..avail_len].copy_from_slice(__input);
32141 Bytes::new(&payload_buf)
32142 } else {
32143 Bytes::new(__input)
32144 };
32145 let mut __struct = Self::default();
32146 __struct.framerate = buf.get_f32_le()?;
32147 __struct.bitrate = buf.get_u32_le()?;
32148 let tmp = buf.get_u16_le()?;
32149 __struct.flags =
32150 VideoStreamStatusFlags::from_bits(tmp as <VideoStreamStatusFlags as Flags>::Bits)
32151 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32152 flag_type: "VideoStreamStatusFlags",
32153 value: tmp as u64,
32154 })?;
32155 __struct.resolution_h = buf.get_u16_le()?;
32156 __struct.resolution_v = buf.get_u16_le()?;
32157 __struct.rotation = buf.get_u16_le()?;
32158 __struct.hfov = buf.get_u16_le()?;
32159 __struct.stream_id = buf.get_u8()?;
32160 __struct.count = buf.get_u8()?;
32161 let tmp = buf.get_u8()?;
32162 __struct.mavtype =
32163 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32164 enum_type: "VideoStreamType",
32165 value: tmp as u64,
32166 })?;
32167 let mut tmp = [0_u8; 32usize];
32168 for v in &mut tmp {
32169 *v = buf.get_u8()?;
32170 }
32171 __struct.name = CharArray::new(tmp);
32172 let mut tmp = [0_u8; 160usize];
32173 for v in &mut tmp {
32174 *v = buf.get_u8()?;
32175 }
32176 __struct.uri = CharArray::new(tmp);
32177 let tmp = buf.get_u8()?;
32178 __struct.encoding =
32179 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32180 enum_type: "VideoStreamEncoding",
32181 value: tmp as u64,
32182 })?;
32183 __struct.camera_device_id = buf.get_u8()?;
32184 Ok(__struct)
32185 }
32186 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32187 let mut __tmp = BytesMut::new(bytes);
32188 #[allow(clippy::absurd_extreme_comparisons)]
32189 #[allow(unused_comparisons)]
32190 if __tmp.remaining() < Self::ENCODED_LEN {
32191 panic!(
32192 "buffer is too small (need {} bytes, but got {})",
32193 Self::ENCODED_LEN,
32194 __tmp.remaining(),
32195 )
32196 }
32197 __tmp.put_f32_le(self.framerate);
32198 __tmp.put_u32_le(self.bitrate);
32199 __tmp.put_u16_le(self.flags.bits() as u16);
32200 __tmp.put_u16_le(self.resolution_h);
32201 __tmp.put_u16_le(self.resolution_v);
32202 __tmp.put_u16_le(self.rotation);
32203 __tmp.put_u16_le(self.hfov);
32204 __tmp.put_u8(self.stream_id);
32205 __tmp.put_u8(self.count);
32206 __tmp.put_u8(self.mavtype as u8);
32207 for val in &self.name {
32208 __tmp.put_u8(*val);
32209 }
32210 for val in &self.uri {
32211 __tmp.put_u8(*val);
32212 }
32213 if matches!(version, MavlinkVersion::V2) {
32214 __tmp.put_u8(self.encoding as u8);
32215 __tmp.put_u8(self.camera_device_id);
32216 let len = __tmp.len();
32217 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32218 } else {
32219 __tmp.len()
32220 }
32221 }
32222}
32223#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
32224#[doc = ""]
32225#[doc = "ID: 270"]
32226#[derive(Debug, Clone, PartialEq)]
32227#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32228#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32229#[cfg_attr(feature = "ts", derive(TS))]
32230#[cfg_attr(feature = "ts", ts(export))]
32231pub struct VIDEO_STREAM_STATUS_DATA {
32232 #[doc = "Frame rate"]
32233 pub framerate: f32,
32234 #[doc = "Bit rate"]
32235 pub bitrate: u32,
32236 #[doc = "Bitmap of stream status flags"]
32237 pub flags: VideoStreamStatusFlags,
32238 #[doc = "Horizontal resolution"]
32239 pub resolution_h: u16,
32240 #[doc = "Vertical resolution"]
32241 pub resolution_v: u16,
32242 #[doc = "Video image rotation clockwise"]
32243 pub rotation: u16,
32244 #[doc = "Horizontal Field of view"]
32245 pub hfov: u16,
32246 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
32247 pub stream_id: u8,
32248 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
32249 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32250 pub camera_device_id: u8,
32251}
32252impl VIDEO_STREAM_STATUS_DATA {
32253 pub const ENCODED_LEN: usize = 20usize;
32254 pub const DEFAULT: Self = Self {
32255 framerate: 0.0_f32,
32256 bitrate: 0_u32,
32257 flags: VideoStreamStatusFlags::DEFAULT,
32258 resolution_h: 0_u16,
32259 resolution_v: 0_u16,
32260 rotation: 0_u16,
32261 hfov: 0_u16,
32262 stream_id: 0_u8,
32263 camera_device_id: 0_u8,
32264 };
32265 #[cfg(feature = "arbitrary")]
32266 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32267 use arbitrary::{Arbitrary, Unstructured};
32268 let mut buf = [0u8; 1024];
32269 rng.fill_bytes(&mut buf);
32270 let mut unstructured = Unstructured::new(&buf);
32271 Self::arbitrary(&mut unstructured).unwrap_or_default()
32272 }
32273}
32274impl Default for VIDEO_STREAM_STATUS_DATA {
32275 fn default() -> Self {
32276 Self::DEFAULT.clone()
32277 }
32278}
32279impl MessageData for VIDEO_STREAM_STATUS_DATA {
32280 type Message = MavMessage;
32281 const ID: u32 = 270u32;
32282 const NAME: &'static str = "VIDEO_STREAM_STATUS";
32283 const EXTRA_CRC: u8 = 59u8;
32284 const ENCODED_LEN: usize = 20usize;
32285 fn deser(
32286 _version: MavlinkVersion,
32287 __input: &[u8],
32288 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32289 let avail_len = __input.len();
32290 let mut payload_buf = [0; Self::ENCODED_LEN];
32291 let mut buf = if avail_len < Self::ENCODED_LEN {
32292 payload_buf[0..avail_len].copy_from_slice(__input);
32293 Bytes::new(&payload_buf)
32294 } else {
32295 Bytes::new(__input)
32296 };
32297 let mut __struct = Self::default();
32298 __struct.framerate = buf.get_f32_le()?;
32299 __struct.bitrate = buf.get_u32_le()?;
32300 let tmp = buf.get_u16_le()?;
32301 __struct.flags =
32302 VideoStreamStatusFlags::from_bits(tmp as <VideoStreamStatusFlags as Flags>::Bits)
32303 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32304 flag_type: "VideoStreamStatusFlags",
32305 value: tmp as u64,
32306 })?;
32307 __struct.resolution_h = buf.get_u16_le()?;
32308 __struct.resolution_v = buf.get_u16_le()?;
32309 __struct.rotation = buf.get_u16_le()?;
32310 __struct.hfov = buf.get_u16_le()?;
32311 __struct.stream_id = buf.get_u8()?;
32312 __struct.camera_device_id = buf.get_u8()?;
32313 Ok(__struct)
32314 }
32315 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32316 let mut __tmp = BytesMut::new(bytes);
32317 #[allow(clippy::absurd_extreme_comparisons)]
32318 #[allow(unused_comparisons)]
32319 if __tmp.remaining() < Self::ENCODED_LEN {
32320 panic!(
32321 "buffer is too small (need {} bytes, but got {})",
32322 Self::ENCODED_LEN,
32323 __tmp.remaining(),
32324 )
32325 }
32326 __tmp.put_f32_le(self.framerate);
32327 __tmp.put_u32_le(self.bitrate);
32328 __tmp.put_u16_le(self.flags.bits() as u16);
32329 __tmp.put_u16_le(self.resolution_h);
32330 __tmp.put_u16_le(self.resolution_v);
32331 __tmp.put_u16_le(self.rotation);
32332 __tmp.put_u16_le(self.hfov);
32333 __tmp.put_u8(self.stream_id);
32334 if matches!(version, MavlinkVersion::V2) {
32335 __tmp.put_u8(self.camera_device_id);
32336 let len = __tmp.len();
32337 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32338 } else {
32339 __tmp.len()
32340 }
32341 }
32342}
32343#[doc = "Local position/attitude estimate from a vision source."]
32344#[doc = ""]
32345#[doc = "ID: 102"]
32346#[derive(Debug, Clone, PartialEq)]
32347#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32348#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32349#[cfg_attr(feature = "ts", derive(TS))]
32350#[cfg_attr(feature = "ts", ts(export))]
32351pub struct VISION_POSITION_ESTIMATE_DATA {
32352 #[doc = "Timestamp (UNIX time or time since system boot)"]
32353 pub usec: u64,
32354 #[doc = "Local X position"]
32355 pub x: f32,
32356 #[doc = "Local Y position"]
32357 pub y: f32,
32358 #[doc = "Local Z position"]
32359 pub z: f32,
32360 #[doc = "Roll angle"]
32361 pub roll: f32,
32362 #[doc = "Pitch angle"]
32363 pub pitch: f32,
32364 #[doc = "Yaw angle"]
32365 pub yaw: f32,
32366 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
32367 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32368 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32369 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32370 pub covariance: [f32; 21],
32371 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
32372 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32373 pub reset_counter: u8,
32374}
32375impl VISION_POSITION_ESTIMATE_DATA {
32376 pub const ENCODED_LEN: usize = 117usize;
32377 pub const DEFAULT: Self = Self {
32378 usec: 0_u64,
32379 x: 0.0_f32,
32380 y: 0.0_f32,
32381 z: 0.0_f32,
32382 roll: 0.0_f32,
32383 pitch: 0.0_f32,
32384 yaw: 0.0_f32,
32385 covariance: [0.0_f32; 21usize],
32386 reset_counter: 0_u8,
32387 };
32388 #[cfg(feature = "arbitrary")]
32389 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32390 use arbitrary::{Arbitrary, Unstructured};
32391 let mut buf = [0u8; 1024];
32392 rng.fill_bytes(&mut buf);
32393 let mut unstructured = Unstructured::new(&buf);
32394 Self::arbitrary(&mut unstructured).unwrap_or_default()
32395 }
32396}
32397impl Default for VISION_POSITION_ESTIMATE_DATA {
32398 fn default() -> Self {
32399 Self::DEFAULT.clone()
32400 }
32401}
32402impl MessageData for VISION_POSITION_ESTIMATE_DATA {
32403 type Message = MavMessage;
32404 const ID: u32 = 102u32;
32405 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
32406 const EXTRA_CRC: u8 = 158u8;
32407 const ENCODED_LEN: usize = 117usize;
32408 fn deser(
32409 _version: MavlinkVersion,
32410 __input: &[u8],
32411 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32412 let avail_len = __input.len();
32413 let mut payload_buf = [0; Self::ENCODED_LEN];
32414 let mut buf = if avail_len < Self::ENCODED_LEN {
32415 payload_buf[0..avail_len].copy_from_slice(__input);
32416 Bytes::new(&payload_buf)
32417 } else {
32418 Bytes::new(__input)
32419 };
32420 let mut __struct = Self::default();
32421 __struct.usec = buf.get_u64_le()?;
32422 __struct.x = buf.get_f32_le()?;
32423 __struct.y = buf.get_f32_le()?;
32424 __struct.z = buf.get_f32_le()?;
32425 __struct.roll = buf.get_f32_le()?;
32426 __struct.pitch = buf.get_f32_le()?;
32427 __struct.yaw = buf.get_f32_le()?;
32428 for v in &mut __struct.covariance {
32429 let val = buf.get_f32_le()?;
32430 *v = val;
32431 }
32432 __struct.reset_counter = buf.get_u8()?;
32433 Ok(__struct)
32434 }
32435 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32436 let mut __tmp = BytesMut::new(bytes);
32437 #[allow(clippy::absurd_extreme_comparisons)]
32438 #[allow(unused_comparisons)]
32439 if __tmp.remaining() < Self::ENCODED_LEN {
32440 panic!(
32441 "buffer is too small (need {} bytes, but got {})",
32442 Self::ENCODED_LEN,
32443 __tmp.remaining(),
32444 )
32445 }
32446 __tmp.put_u64_le(self.usec);
32447 __tmp.put_f32_le(self.x);
32448 __tmp.put_f32_le(self.y);
32449 __tmp.put_f32_le(self.z);
32450 __tmp.put_f32_le(self.roll);
32451 __tmp.put_f32_le(self.pitch);
32452 __tmp.put_f32_le(self.yaw);
32453 if matches!(version, MavlinkVersion::V2) {
32454 for val in &self.covariance {
32455 __tmp.put_f32_le(*val);
32456 }
32457 __tmp.put_u8(self.reset_counter);
32458 let len = __tmp.len();
32459 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32460 } else {
32461 __tmp.len()
32462 }
32463 }
32464}
32465#[doc = "Speed estimate from a vision source."]
32466#[doc = ""]
32467#[doc = "ID: 103"]
32468#[derive(Debug, Clone, PartialEq)]
32469#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32470#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32471#[cfg_attr(feature = "ts", derive(TS))]
32472#[cfg_attr(feature = "ts", ts(export))]
32473pub struct VISION_SPEED_ESTIMATE_DATA {
32474 #[doc = "Timestamp (UNIX time or time since system boot)"]
32475 pub usec: u64,
32476 #[doc = "Global X speed"]
32477 pub x: f32,
32478 #[doc = "Global Y speed"]
32479 pub y: f32,
32480 #[doc = "Global Z speed"]
32481 pub z: f32,
32482 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
32483 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32484 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32485 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32486 pub covariance: [f32; 9],
32487 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
32488 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
32489 pub reset_counter: u8,
32490}
32491impl VISION_SPEED_ESTIMATE_DATA {
32492 pub const ENCODED_LEN: usize = 57usize;
32493 pub const DEFAULT: Self = Self {
32494 usec: 0_u64,
32495 x: 0.0_f32,
32496 y: 0.0_f32,
32497 z: 0.0_f32,
32498 covariance: [0.0_f32; 9usize],
32499 reset_counter: 0_u8,
32500 };
32501 #[cfg(feature = "arbitrary")]
32502 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32503 use arbitrary::{Arbitrary, Unstructured};
32504 let mut buf = [0u8; 1024];
32505 rng.fill_bytes(&mut buf);
32506 let mut unstructured = Unstructured::new(&buf);
32507 Self::arbitrary(&mut unstructured).unwrap_or_default()
32508 }
32509}
32510impl Default for VISION_SPEED_ESTIMATE_DATA {
32511 fn default() -> Self {
32512 Self::DEFAULT.clone()
32513 }
32514}
32515impl MessageData for VISION_SPEED_ESTIMATE_DATA {
32516 type Message = MavMessage;
32517 const ID: u32 = 103u32;
32518 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
32519 const EXTRA_CRC: u8 = 208u8;
32520 const ENCODED_LEN: usize = 57usize;
32521 fn deser(
32522 _version: MavlinkVersion,
32523 __input: &[u8],
32524 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32525 let avail_len = __input.len();
32526 let mut payload_buf = [0; Self::ENCODED_LEN];
32527 let mut buf = if avail_len < Self::ENCODED_LEN {
32528 payload_buf[0..avail_len].copy_from_slice(__input);
32529 Bytes::new(&payload_buf)
32530 } else {
32531 Bytes::new(__input)
32532 };
32533 let mut __struct = Self::default();
32534 __struct.usec = buf.get_u64_le()?;
32535 __struct.x = buf.get_f32_le()?;
32536 __struct.y = buf.get_f32_le()?;
32537 __struct.z = buf.get_f32_le()?;
32538 for v in &mut __struct.covariance {
32539 let val = buf.get_f32_le()?;
32540 *v = val;
32541 }
32542 __struct.reset_counter = buf.get_u8()?;
32543 Ok(__struct)
32544 }
32545 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32546 let mut __tmp = BytesMut::new(bytes);
32547 #[allow(clippy::absurd_extreme_comparisons)]
32548 #[allow(unused_comparisons)]
32549 if __tmp.remaining() < Self::ENCODED_LEN {
32550 panic!(
32551 "buffer is too small (need {} bytes, but got {})",
32552 Self::ENCODED_LEN,
32553 __tmp.remaining(),
32554 )
32555 }
32556 __tmp.put_u64_le(self.usec);
32557 __tmp.put_f32_le(self.x);
32558 __tmp.put_f32_le(self.y);
32559 __tmp.put_f32_le(self.z);
32560 if matches!(version, MavlinkVersion::V2) {
32561 for val in &self.covariance {
32562 __tmp.put_f32_le(*val);
32563 }
32564 __tmp.put_u8(self.reset_counter);
32565 let len = __tmp.len();
32566 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32567 } else {
32568 __tmp.len()
32569 }
32570 }
32571}
32572#[doc = "Cumulative distance traveled for each reported wheel."]
32573#[doc = ""]
32574#[doc = "ID: 9000"]
32575#[derive(Debug, Clone, PartialEq)]
32576#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32577#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32578#[cfg_attr(feature = "ts", derive(TS))]
32579#[cfg_attr(feature = "ts", ts(export))]
32580pub struct WHEEL_DISTANCE_DATA {
32581 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32582 pub time_usec: u64,
32583 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
32584 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
32585 #[cfg_attr(feature = "ts", ts(type = "Array<number>"))]
32586 pub distance: [f64; 16],
32587 #[doc = "Number of wheels reported."]
32588 pub count: u8,
32589}
32590impl WHEEL_DISTANCE_DATA {
32591 pub const ENCODED_LEN: usize = 137usize;
32592 pub const DEFAULT: Self = Self {
32593 time_usec: 0_u64,
32594 distance: [0.0_f64; 16usize],
32595 count: 0_u8,
32596 };
32597 #[cfg(feature = "arbitrary")]
32598 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32599 use arbitrary::{Arbitrary, Unstructured};
32600 let mut buf = [0u8; 1024];
32601 rng.fill_bytes(&mut buf);
32602 let mut unstructured = Unstructured::new(&buf);
32603 Self::arbitrary(&mut unstructured).unwrap_or_default()
32604 }
32605}
32606impl Default for WHEEL_DISTANCE_DATA {
32607 fn default() -> Self {
32608 Self::DEFAULT.clone()
32609 }
32610}
32611impl MessageData for WHEEL_DISTANCE_DATA {
32612 type Message = MavMessage;
32613 const ID: u32 = 9000u32;
32614 const NAME: &'static str = "WHEEL_DISTANCE";
32615 const EXTRA_CRC: u8 = 113u8;
32616 const ENCODED_LEN: usize = 137usize;
32617 fn deser(
32618 _version: MavlinkVersion,
32619 __input: &[u8],
32620 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32621 let avail_len = __input.len();
32622 let mut payload_buf = [0; Self::ENCODED_LEN];
32623 let mut buf = if avail_len < Self::ENCODED_LEN {
32624 payload_buf[0..avail_len].copy_from_slice(__input);
32625 Bytes::new(&payload_buf)
32626 } else {
32627 Bytes::new(__input)
32628 };
32629 let mut __struct = Self::default();
32630 __struct.time_usec = buf.get_u64_le()?;
32631 for v in &mut __struct.distance {
32632 let val = buf.get_f64_le()?;
32633 *v = val;
32634 }
32635 __struct.count = buf.get_u8()?;
32636 Ok(__struct)
32637 }
32638 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32639 let mut __tmp = BytesMut::new(bytes);
32640 #[allow(clippy::absurd_extreme_comparisons)]
32641 #[allow(unused_comparisons)]
32642 if __tmp.remaining() < Self::ENCODED_LEN {
32643 panic!(
32644 "buffer is too small (need {} bytes, but got {})",
32645 Self::ENCODED_LEN,
32646 __tmp.remaining(),
32647 )
32648 }
32649 __tmp.put_u64_le(self.time_usec);
32650 for val in &self.distance {
32651 __tmp.put_f64_le(*val);
32652 }
32653 __tmp.put_u8(self.count);
32654 if matches!(version, MavlinkVersion::V2) {
32655 let len = __tmp.len();
32656 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32657 } else {
32658 __tmp.len()
32659 }
32660 }
32661}
32662#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32663#[doc = ""]
32664#[doc = "ID: 299"]
32665#[derive(Debug, Clone, PartialEq)]
32666#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32667#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32668#[cfg_attr(feature = "ts", derive(TS))]
32669#[cfg_attr(feature = "ts", ts(export))]
32670pub struct WIFI_CONFIG_AP_DATA {
32671 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
32672 #[cfg_attr(feature = "ts", ts(type = "string"))]
32673 pub ssid: CharArray<32>,
32674 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
32675 #[cfg_attr(feature = "ts", ts(type = "string"))]
32676 pub password: CharArray<64>,
32677 #[doc = "WiFi Mode."]
32678 #[cfg_attr(feature = "serde", serde(default))]
32679 pub mode: WifiConfigApMode,
32680 #[doc = "Message acceptance response (sent back to GS)."]
32681 #[cfg_attr(feature = "serde", serde(default))]
32682 pub response: WifiConfigApResponse,
32683}
32684impl WIFI_CONFIG_AP_DATA {
32685 pub const ENCODED_LEN: usize = 98usize;
32686 pub const DEFAULT: Self = Self {
32687 ssid: CharArray::new([0_u8; 32usize]),
32688 password: CharArray::new([0_u8; 64usize]),
32689 mode: WifiConfigApMode::DEFAULT,
32690 response: WifiConfigApResponse::DEFAULT,
32691 };
32692 #[cfg(feature = "arbitrary")]
32693 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32694 use arbitrary::{Arbitrary, Unstructured};
32695 let mut buf = [0u8; 1024];
32696 rng.fill_bytes(&mut buf);
32697 let mut unstructured = Unstructured::new(&buf);
32698 Self::arbitrary(&mut unstructured).unwrap_or_default()
32699 }
32700}
32701impl Default for WIFI_CONFIG_AP_DATA {
32702 fn default() -> Self {
32703 Self::DEFAULT.clone()
32704 }
32705}
32706impl MessageData for WIFI_CONFIG_AP_DATA {
32707 type Message = MavMessage;
32708 const ID: u32 = 299u32;
32709 const NAME: &'static str = "WIFI_CONFIG_AP";
32710 const EXTRA_CRC: u8 = 19u8;
32711 const ENCODED_LEN: usize = 98usize;
32712 fn deser(
32713 _version: MavlinkVersion,
32714 __input: &[u8],
32715 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32716 let avail_len = __input.len();
32717 let mut payload_buf = [0; Self::ENCODED_LEN];
32718 let mut buf = if avail_len < Self::ENCODED_LEN {
32719 payload_buf[0..avail_len].copy_from_slice(__input);
32720 Bytes::new(&payload_buf)
32721 } else {
32722 Bytes::new(__input)
32723 };
32724 let mut __struct = Self::default();
32725 let mut tmp = [0_u8; 32usize];
32726 for v in &mut tmp {
32727 *v = buf.get_u8()?;
32728 }
32729 __struct.ssid = CharArray::new(tmp);
32730 let mut tmp = [0_u8; 64usize];
32731 for v in &mut tmp {
32732 *v = buf.get_u8()?;
32733 }
32734 __struct.password = CharArray::new(tmp);
32735 let tmp = buf.get_i8()?;
32736 __struct.mode =
32737 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32738 enum_type: "WifiConfigApMode",
32739 value: tmp as u64,
32740 })?;
32741 let tmp = buf.get_i8()?;
32742 __struct.response =
32743 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
32744 enum_type: "WifiConfigApResponse",
32745 value: tmp as u64,
32746 })?;
32747 Ok(__struct)
32748 }
32749 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32750 let mut __tmp = BytesMut::new(bytes);
32751 #[allow(clippy::absurd_extreme_comparisons)]
32752 #[allow(unused_comparisons)]
32753 if __tmp.remaining() < Self::ENCODED_LEN {
32754 panic!(
32755 "buffer is too small (need {} bytes, but got {})",
32756 Self::ENCODED_LEN,
32757 __tmp.remaining(),
32758 )
32759 }
32760 for val in &self.ssid {
32761 __tmp.put_u8(*val);
32762 }
32763 for val in &self.password {
32764 __tmp.put_u8(*val);
32765 }
32766 if matches!(version, MavlinkVersion::V2) {
32767 __tmp.put_i8(self.mode as i8);
32768 __tmp.put_i8(self.response as i8);
32769 let len = __tmp.len();
32770 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32771 } else {
32772 __tmp.len()
32773 }
32774 }
32775}
32776#[doc = "Winch status."]
32777#[doc = ""]
32778#[doc = "ID: 9005"]
32779#[derive(Debug, Clone, PartialEq)]
32780#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32781#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32782#[cfg_attr(feature = "ts", derive(TS))]
32783#[cfg_attr(feature = "ts", ts(export))]
32784pub struct WINCH_STATUS_DATA {
32785 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
32786 pub time_usec: u64,
32787 #[doc = "Length of line released. NaN if unknown"]
32788 pub line_length: f32,
32789 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
32790 pub speed: f32,
32791 #[doc = "Tension on the line. NaN if unknown"]
32792 pub tension: f32,
32793 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
32794 pub voltage: f32,
32795 #[doc = "Current draw from the winch. NaN if unknown"]
32796 pub current: f32,
32797 #[doc = "Status flags"]
32798 pub status: MavWinchStatusFlag,
32799 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
32800 pub temperature: i16,
32801}
32802impl WINCH_STATUS_DATA {
32803 pub const ENCODED_LEN: usize = 34usize;
32804 pub const DEFAULT: Self = Self {
32805 time_usec: 0_u64,
32806 line_length: 0.0_f32,
32807 speed: 0.0_f32,
32808 tension: 0.0_f32,
32809 voltage: 0.0_f32,
32810 current: 0.0_f32,
32811 status: MavWinchStatusFlag::DEFAULT,
32812 temperature: 0_i16,
32813 };
32814 #[cfg(feature = "arbitrary")]
32815 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32816 use arbitrary::{Arbitrary, Unstructured};
32817 let mut buf = [0u8; 1024];
32818 rng.fill_bytes(&mut buf);
32819 let mut unstructured = Unstructured::new(&buf);
32820 Self::arbitrary(&mut unstructured).unwrap_or_default()
32821 }
32822}
32823impl Default for WINCH_STATUS_DATA {
32824 fn default() -> Self {
32825 Self::DEFAULT.clone()
32826 }
32827}
32828impl MessageData for WINCH_STATUS_DATA {
32829 type Message = MavMessage;
32830 const ID: u32 = 9005u32;
32831 const NAME: &'static str = "WINCH_STATUS";
32832 const EXTRA_CRC: u8 = 117u8;
32833 const ENCODED_LEN: usize = 34usize;
32834 fn deser(
32835 _version: MavlinkVersion,
32836 __input: &[u8],
32837 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32838 let avail_len = __input.len();
32839 let mut payload_buf = [0; Self::ENCODED_LEN];
32840 let mut buf = if avail_len < Self::ENCODED_LEN {
32841 payload_buf[0..avail_len].copy_from_slice(__input);
32842 Bytes::new(&payload_buf)
32843 } else {
32844 Bytes::new(__input)
32845 };
32846 let mut __struct = Self::default();
32847 __struct.time_usec = buf.get_u64_le()?;
32848 __struct.line_length = buf.get_f32_le()?;
32849 __struct.speed = buf.get_f32_le()?;
32850 __struct.tension = buf.get_f32_le()?;
32851 __struct.voltage = buf.get_f32_le()?;
32852 __struct.current = buf.get_f32_le()?;
32853 let tmp = buf.get_u32_le()?;
32854 __struct.status = MavWinchStatusFlag::from_bits(tmp as <MavWinchStatusFlag as Flags>::Bits)
32855 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
32856 flag_type: "MavWinchStatusFlag",
32857 value: tmp as u64,
32858 })?;
32859 __struct.temperature = buf.get_i16_le()?;
32860 Ok(__struct)
32861 }
32862 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32863 let mut __tmp = BytesMut::new(bytes);
32864 #[allow(clippy::absurd_extreme_comparisons)]
32865 #[allow(unused_comparisons)]
32866 if __tmp.remaining() < Self::ENCODED_LEN {
32867 panic!(
32868 "buffer is too small (need {} bytes, but got {})",
32869 Self::ENCODED_LEN,
32870 __tmp.remaining(),
32871 )
32872 }
32873 __tmp.put_u64_le(self.time_usec);
32874 __tmp.put_f32_le(self.line_length);
32875 __tmp.put_f32_le(self.speed);
32876 __tmp.put_f32_le(self.tension);
32877 __tmp.put_f32_le(self.voltage);
32878 __tmp.put_f32_le(self.current);
32879 __tmp.put_u32_le(self.status.bits() as u32);
32880 __tmp.put_i16_le(self.temperature);
32881 if matches!(version, MavlinkVersion::V2) {
32882 let len = __tmp.len();
32883 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32884 } else {
32885 __tmp.len()
32886 }
32887 }
32888}
32889#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
32890#[doc = ""]
32891#[doc = "ID: 231"]
32892#[derive(Debug, Clone, PartialEq)]
32893#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
32894#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
32895#[cfg_attr(feature = "ts", derive(TS))]
32896#[cfg_attr(feature = "ts", ts(export))]
32897pub struct WIND_COV_DATA {
32898 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
32899 pub time_usec: u64,
32900 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
32901 pub wind_x: f32,
32902 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
32903 pub wind_y: f32,
32904 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
32905 pub wind_z: f32,
32906 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
32907 pub var_horiz: f32,
32908 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
32909 pub var_vert: f32,
32910 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
32911 pub wind_alt: f32,
32912 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
32913 pub horiz_accuracy: f32,
32914 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
32915 pub vert_accuracy: f32,
32916}
32917impl WIND_COV_DATA {
32918 pub const ENCODED_LEN: usize = 40usize;
32919 pub const DEFAULT: Self = Self {
32920 time_usec: 0_u64,
32921 wind_x: 0.0_f32,
32922 wind_y: 0.0_f32,
32923 wind_z: 0.0_f32,
32924 var_horiz: 0.0_f32,
32925 var_vert: 0.0_f32,
32926 wind_alt: 0.0_f32,
32927 horiz_accuracy: 0.0_f32,
32928 vert_accuracy: 0.0_f32,
32929 };
32930 #[cfg(feature = "arbitrary")]
32931 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
32932 use arbitrary::{Arbitrary, Unstructured};
32933 let mut buf = [0u8; 1024];
32934 rng.fill_bytes(&mut buf);
32935 let mut unstructured = Unstructured::new(&buf);
32936 Self::arbitrary(&mut unstructured).unwrap_or_default()
32937 }
32938}
32939impl Default for WIND_COV_DATA {
32940 fn default() -> Self {
32941 Self::DEFAULT.clone()
32942 }
32943}
32944impl MessageData for WIND_COV_DATA {
32945 type Message = MavMessage;
32946 const ID: u32 = 231u32;
32947 const NAME: &'static str = "WIND_COV";
32948 const EXTRA_CRC: u8 = 105u8;
32949 const ENCODED_LEN: usize = 40usize;
32950 fn deser(
32951 _version: MavlinkVersion,
32952 __input: &[u8],
32953 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32954 let avail_len = __input.len();
32955 let mut payload_buf = [0; Self::ENCODED_LEN];
32956 let mut buf = if avail_len < Self::ENCODED_LEN {
32957 payload_buf[0..avail_len].copy_from_slice(__input);
32958 Bytes::new(&payload_buf)
32959 } else {
32960 Bytes::new(__input)
32961 };
32962 let mut __struct = Self::default();
32963 __struct.time_usec = buf.get_u64_le()?;
32964 __struct.wind_x = buf.get_f32_le()?;
32965 __struct.wind_y = buf.get_f32_le()?;
32966 __struct.wind_z = buf.get_f32_le()?;
32967 __struct.var_horiz = buf.get_f32_le()?;
32968 __struct.var_vert = buf.get_f32_le()?;
32969 __struct.wind_alt = buf.get_f32_le()?;
32970 __struct.horiz_accuracy = buf.get_f32_le()?;
32971 __struct.vert_accuracy = buf.get_f32_le()?;
32972 Ok(__struct)
32973 }
32974 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
32975 let mut __tmp = BytesMut::new(bytes);
32976 #[allow(clippy::absurd_extreme_comparisons)]
32977 #[allow(unused_comparisons)]
32978 if __tmp.remaining() < Self::ENCODED_LEN {
32979 panic!(
32980 "buffer is too small (need {} bytes, but got {})",
32981 Self::ENCODED_LEN,
32982 __tmp.remaining(),
32983 )
32984 }
32985 __tmp.put_u64_le(self.time_usec);
32986 __tmp.put_f32_le(self.wind_x);
32987 __tmp.put_f32_le(self.wind_y);
32988 __tmp.put_f32_le(self.wind_z);
32989 __tmp.put_f32_le(self.var_horiz);
32990 __tmp.put_f32_le(self.var_vert);
32991 __tmp.put_f32_le(self.wind_alt);
32992 __tmp.put_f32_le(self.horiz_accuracy);
32993 __tmp.put_f32_le(self.vert_accuracy);
32994 if matches!(version, MavlinkVersion::V2) {
32995 let len = __tmp.len();
32996 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
32997 } else {
32998 __tmp.len()
32999 }
33000 }
33001}
33002#[derive(Clone, PartialEq, Debug)]
33003#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
33004#[cfg_attr(feature = "serde", serde(tag = "type"))]
33005#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
33006#[cfg_attr(feature = "ts", derive(TS))]
33007#[cfg_attr(feature = "ts", ts(export))]
33008#[repr(u32)]
33009pub enum MavMessage {
33010 #[doc = "Set the vehicle attitude and body angular rates."]
33011 #[doc = ""]
33012 #[doc = "ID: 140"]
33013 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
33014 #[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
33015 #[doc = ""]
33016 #[doc = "ID: 375"]
33017 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
33018 #[doc = "The location and information of an ADSB vehicle."]
33019 #[doc = ""]
33020 #[doc = "ID: 246"]
33021 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
33022 #[doc = "The location and information of an AIS vessel."]
33023 #[doc = ""]
33024 #[doc = "ID: 301"]
33025 AIS_VESSEL(AIS_VESSEL_DATA),
33026 #[doc = "The current system altitude."]
33027 #[doc = ""]
33028 #[doc = "ID: 141"]
33029 ALTITUDE(ALTITUDE_DATA),
33030 #[doc = "Array test #0."]
33031 #[doc = ""]
33032 #[doc = "ID: 17150"]
33033 ARRAY_TEST_0(ARRAY_TEST_0_DATA),
33034 #[doc = "Array test #1."]
33035 #[doc = ""]
33036 #[doc = "ID: 17151"]
33037 ARRAY_TEST_1(ARRAY_TEST_1_DATA),
33038 #[doc = "Array test #3."]
33039 #[doc = ""]
33040 #[doc = "ID: 17153"]
33041 ARRAY_TEST_3(ARRAY_TEST_3_DATA),
33042 #[doc = "Array test #4."]
33043 #[doc = ""]
33044 #[doc = "ID: 17154"]
33045 ARRAY_TEST_4(ARRAY_TEST_4_DATA),
33046 #[doc = "Array test #5."]
33047 #[doc = ""]
33048 #[doc = "ID: 17155"]
33049 ARRAY_TEST_5(ARRAY_TEST_5_DATA),
33050 #[doc = "Array test #6."]
33051 #[doc = ""]
33052 #[doc = "ID: 17156"]
33053 ARRAY_TEST_6(ARRAY_TEST_6_DATA),
33054 #[doc = "Array test #7."]
33055 #[doc = ""]
33056 #[doc = "ID: 17157"]
33057 ARRAY_TEST_7(ARRAY_TEST_7_DATA),
33058 #[doc = "Array test #8."]
33059 #[doc = ""]
33060 #[doc = "ID: 17158"]
33061 ARRAY_TEST_8(ARRAY_TEST_8_DATA),
33062 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
33063 #[doc = ""]
33064 #[doc = "ID: 30"]
33065 ATTITUDE(ATTITUDE_DATA),
33066 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
33067 #[doc = ""]
33068 #[doc = "ID: 31"]
33069 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
33070 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
33071 #[doc = ""]
33072 #[doc = "ID: 61"]
33073 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
33074 #[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
33075 #[doc = ""]
33076 #[doc = "ID: 83"]
33077 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
33078 #[doc = "Motion capture attitude and position."]
33079 #[doc = ""]
33080 #[doc = "ID: 138"]
33081 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
33082 #[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
33083 #[doc = ""]
33084 #[doc = "ID: 7"]
33085 AUTH_KEY(AUTH_KEY_DATA),
33086 #[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
33087 #[doc = ""]
33088 #[doc = "ID: 286"]
33089 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
33090 #[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
33091 #[doc = ""]
33092 #[doc = "ID: 148"]
33093 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
33094 #[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
33095 #[doc = ""]
33096 #[doc = "ID: 435"]
33097 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
33098 #[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
33099 #[doc = ""]
33100 #[doc = "ID: 437"]
33101 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
33102 #[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
33103 #[doc = ""]
33104 #[doc = "ID: 372"]
33105 BATTERY_INFO(BATTERY_INFO_DATA),
33106 #[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
33107 #[doc = ""]
33108 #[doc = "ID: 147"]
33109 BATTERY_STATUS(BATTERY_STATUS_DATA),
33110 #[doc = "Report button state change."]
33111 #[doc = ""]
33112 #[doc = "ID: 257"]
33113 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
33114 #[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
33115 #[doc = ""]
33116 #[doc = "ID: 262"]
33117 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
33118 #[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
33119 #[doc = ""]
33120 #[doc = "ID: 271"]
33121 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
33122 #[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
33123 #[doc = ""]
33124 #[doc = "ID: 263"]
33125 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
33126 #[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
33127 #[doc = ""]
33128 #[doc = "ID: 259"]
33129 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
33130 #[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
33131 #[doc = ""]
33132 #[doc = "ID: 260"]
33133 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
33134 #[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
33135 #[doc = ""]
33136 #[doc = "ID: 277"]
33137 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
33138 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
33139 #[doc = ""]
33140 #[doc = "ID: 276"]
33141 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
33142 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
33143 #[doc = ""]
33144 #[doc = "ID: 275"]
33145 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
33146 #[doc = "Camera-IMU triggering and synchronisation message."]
33147 #[doc = ""]
33148 #[doc = "ID: 112"]
33149 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
33150 #[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
33151 #[doc = ""]
33152 #[doc = "ID: 387"]
33153 CANFD_FRAME(CANFD_FRAME_DATA),
33154 #[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
33155 #[doc = ""]
33156 #[doc = "ID: 388"]
33157 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
33158 #[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
33159 #[doc = ""]
33160 #[doc = "ID: 386"]
33161 CAN_FRAME(CAN_FRAME_DATA),
33162 #[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
33163 #[doc = ""]
33164 #[doc = "ID: 336"]
33165 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
33166 #[doc = "Report current used cellular network status."]
33167 #[doc = ""]
33168 #[doc = "ID: 334"]
33169 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
33170 #[doc = "Request to control this MAV."]
33171 #[doc = ""]
33172 #[doc = "ID: 5"]
33173 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
33174 #[doc = "Accept / deny control of this MAV."]
33175 #[doc = ""]
33176 #[doc = "ID: 6"]
33177 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
33178 #[doc = "Information about a potential collision."]
33179 #[doc = ""]
33180 #[doc = "ID: 247"]
33181 COLLISION(COLLISION_DATA),
33182 #[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
33183 #[doc = ""]
33184 #[doc = "ID: 77"]
33185 COMMAND_ACK(COMMAND_ACK_DATA),
33186 #[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
33187 #[doc = ""]
33188 #[doc = "ID: 80"]
33189 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
33190 #[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
33191 #[doc = ""]
33192 #[doc = "ID: 75"]
33193 COMMAND_INT(COMMAND_INT_DATA),
33194 #[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
33195 #[doc = ""]
33196 #[doc = "ID: 76"]
33197 COMMAND_LONG(COMMAND_LONG_DATA),
33198 #[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
33199 #[doc = ""]
33200 #[doc = "ID: 395"]
33201 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
33202 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
33203 #[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
33204 #[doc = ""]
33205 #[doc = "ID: 396"]
33206 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
33207 #[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
33208 #[doc = ""]
33209 #[doc = "ID: 397"]
33210 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
33211 #[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
33212 #[doc = ""]
33213 #[doc = "ID: 146"]
33214 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
33215 #[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
33216 #[doc = ""]
33217 #[doc = "ID: 411"]
33218 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
33219 #[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
33220 #[doc = ""]
33221 #[doc = "ID: 436"]
33222 CURRENT_MODE(CURRENT_MODE_DATA),
33223 #[doc = "Data stream status information."]
33224 #[doc = ""]
33225 #[doc = "ID: 67"]
33226 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
33227 DATA_STREAM(DATA_STREAM_DATA),
33228 #[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
33229 #[doc = ""]
33230 #[doc = "ID: 130"]
33231 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
33232 #[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
33233 #[doc = ""]
33234 #[doc = "ID: 254"]
33235 DEBUG(DEBUG_DATA),
33236 #[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
33237 #[doc = ""]
33238 #[doc = "ID: 350"]
33239 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
33240 #[doc = "To debug something using a named 3D vector."]
33241 #[doc = ""]
33242 #[doc = "ID: 250"]
33243 DEBUG_VECT(DEBUG_VECT_DATA),
33244 #[doc = "Distance sensor information for an onboard rangefinder."]
33245 #[doc = ""]
33246 #[doc = "ID: 132"]
33247 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
33248 #[doc = "EFI status output."]
33249 #[doc = ""]
33250 #[doc = "ID: 225"]
33251 EFI_STATUS(EFI_STATUS_DATA),
33252 #[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
33253 #[doc = ""]
33254 #[doc = "ID: 131"]
33255 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
33256 #[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
33257 #[doc = ""]
33258 #[doc = "ID: 290"]
33259 ESC_INFO(ESC_INFO_DATA),
33260 #[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
33261 #[doc = ""]
33262 #[doc = "ID: 291"]
33263 ESC_STATUS(ESC_STATUS_DATA),
33264 #[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
33265 #[doc = ""]
33266 #[doc = "ID: 230"]
33267 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
33268 #[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
33269 #[doc = ""]
33270 #[doc = "ID: 410"]
33271 EVENT(EVENT_DATA),
33272 #[doc = "Provides state for additional features."]
33273 #[doc = ""]
33274 #[doc = "ID: 245"]
33275 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
33276 #[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
33277 #[doc = ""]
33278 #[doc = "ID: 162"]
33279 FENCE_STATUS(FENCE_STATUS_DATA),
33280 #[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
33281 #[doc = ""]
33282 #[doc = "ID: 110"]
33283 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
33284 #[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
33285 #[doc = ""]
33286 #[doc = "ID: 264"]
33287 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
33288 #[doc = "Current motion information from a designated system."]
33289 #[doc = ""]
33290 #[doc = "ID: 144"]
33291 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
33292 #[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
33293 #[doc = ""]
33294 #[doc = "ID: 371"]
33295 FUEL_STATUS(FUEL_STATUS_DATA),
33296 #[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
33297 #[doc = ""]
33298 #[doc = "ID: 373"]
33299 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
33300 #[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
33301 #[doc = ""]
33302 #[doc = "ID: 285"]
33303 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
33304 #[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
33305 #[doc = ""]
33306 #[doc = "ID: 283"]
33307 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
33308 #[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
33309 #[doc = ""]
33310 #[doc = "ID: 284"]
33311 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
33312 #[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
33313 #[doc = ""]
33314 #[doc = "ID: 280"]
33315 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
33316 #[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
33317 #[doc = ""]
33318 #[doc = "ID: 282"]
33319 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
33320 #[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
33321 #[doc = ""]
33322 #[doc = "ID: 288"]
33323 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
33324 #[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
33325 #[doc = ""]
33326 #[doc = "ID: 287"]
33327 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
33328 #[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
33329 #[doc = ""]
33330 #[doc = "ID: 281"]
33331 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
33332 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
33333 #[doc = ""]
33334 #[doc = "ID: 33"]
33335 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
33336 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
33337 #[doc = ""]
33338 #[doc = "ID: 63"]
33339 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
33340 #[doc = "Global position/attitude estimate from a vision source."]
33341 #[doc = ""]
33342 #[doc = "ID: 101"]
33343 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
33344 #[doc = "Second GPS data."]
33345 #[doc = ""]
33346 #[doc = "ID: 124"]
33347 GPS2_RAW(GPS2_RAW_DATA),
33348 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
33349 #[doc = ""]
33350 #[doc = "ID: 128"]
33351 GPS2_RTK(GPS2_RTK_DATA),
33352 #[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
33353 #[doc = ""]
33354 #[doc = "ID: 49"]
33355 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
33356 #[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
33357 #[doc = ""]
33358 #[doc = "ID: 123"]
33359 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
33360 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
33361 #[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
33362 #[doc = ""]
33363 #[doc = "ID: 232"]
33364 GPS_INPUT(GPS_INPUT_DATA),
33365 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
33366 #[doc = ""]
33367 #[doc = "ID: 24"]
33368 GPS_RAW_INT(GPS_RAW_INT_DATA),
33369 #[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
33370 #[doc = ""]
33371 #[doc = "ID: 233"]
33372 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
33373 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
33374 #[doc = ""]
33375 #[doc = "ID: 127"]
33376 GPS_RTK(GPS_RTK_DATA),
33377 #[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
33378 #[doc = ""]
33379 #[doc = "ID: 25"]
33380 GPS_STATUS(GPS_STATUS_DATA),
33381 #[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
33382 #[doc = ""]
33383 #[doc = "ID: 0"]
33384 HEARTBEAT(HEARTBEAT_DATA),
33385 #[doc = "The IMU readings in SI units in NED body frame."]
33386 #[doc = ""]
33387 #[doc = "ID: 105"]
33388 HIGHRES_IMU(HIGHRES_IMU_DATA),
33389 #[doc = "Message appropriate for high latency connections like Iridium."]
33390 #[doc = ""]
33391 #[doc = "ID: 234"]
33392 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
33393 HIGH_LATENCY(HIGH_LATENCY_DATA),
33394 #[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
33395 #[doc = ""]
33396 #[doc = "ID: 235"]
33397 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
33398 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
33399 #[doc = ""]
33400 #[doc = "ID: 93"]
33401 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
33402 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
33403 #[doc = ""]
33404 #[doc = "ID: 91"]
33405 HIL_CONTROLS(HIL_CONTROLS_DATA),
33406 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
33407 #[doc = ""]
33408 #[doc = "ID: 113"]
33409 HIL_GPS(HIL_GPS_DATA),
33410 #[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
33411 #[doc = ""]
33412 #[doc = "ID: 114"]
33413 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
33414 #[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
33415 #[doc = ""]
33416 #[doc = "ID: 92"]
33417 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
33418 #[doc = "The IMU readings in SI units in NED body frame."]
33419 #[doc = ""]
33420 #[doc = "ID: 107"]
33421 HIL_SENSOR(HIL_SENSOR_DATA),
33422 #[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
33423 #[doc = ""]
33424 #[doc = "ID: 90"]
33425 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
33426 HIL_STATE(HIL_STATE_DATA),
33427 #[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
33428 #[doc = ""]
33429 #[doc = "ID: 115"]
33430 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
33431 #[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
33432 #[doc = ""]
33433 #[doc = "ID: 242"]
33434 HOME_POSITION(HOME_POSITION_DATA),
33435 #[doc = "Temperature and humidity from hygrometer."]
33436 #[doc = ""]
33437 #[doc = "ID: 12920"]
33438 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
33439 #[doc = "Illuminator status."]
33440 #[doc = ""]
33441 #[doc = "ID: 440"]
33442 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
33443 #[doc = "Status of the Iridium SBD link."]
33444 #[doc = ""]
33445 #[doc = "ID: 335"]
33446 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
33447 #[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
33448 #[doc = ""]
33449 #[doc = "ID: 149"]
33450 LANDING_TARGET(LANDING_TARGET_DATA),
33451 #[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
33452 #[doc = ""]
33453 #[doc = "ID: 8"]
33454 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
33455 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
33456 #[doc = ""]
33457 #[doc = "ID: 32"]
33458 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
33459 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
33460 #[doc = ""]
33461 #[doc = "ID: 64"]
33462 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
33463 #[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
33464 #[doc = ""]
33465 #[doc = "ID: 89"]
33466 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
33467 #[doc = "An ack for a LOGGING_DATA_ACKED message."]
33468 #[doc = ""]
33469 #[doc = "ID: 268"]
33470 LOGGING_ACK(LOGGING_ACK_DATA),
33471 #[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
33472 #[doc = ""]
33473 #[doc = "ID: 266"]
33474 LOGGING_DATA(LOGGING_DATA_DATA),
33475 #[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
33476 #[doc = ""]
33477 #[doc = "ID: 267"]
33478 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
33479 #[doc = "Reply to LOG_REQUEST_DATA."]
33480 #[doc = ""]
33481 #[doc = "ID: 120"]
33482 LOG_DATA(LOG_DATA_DATA),
33483 #[doc = "Reply to LOG_REQUEST_LIST."]
33484 #[doc = ""]
33485 #[doc = "ID: 118"]
33486 LOG_ENTRY(LOG_ENTRY_DATA),
33487 #[doc = "Erase all logs."]
33488 #[doc = ""]
33489 #[doc = "ID: 121"]
33490 LOG_ERASE(LOG_ERASE_DATA),
33491 #[doc = "Request a chunk of a log."]
33492 #[doc = ""]
33493 #[doc = "ID: 119"]
33494 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
33495 #[doc = "Stop log transfer and resume normal logging."]
33496 #[doc = ""]
33497 #[doc = "ID: 122"]
33498 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
33499 #[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
33500 #[doc = ""]
33501 #[doc = "ID: 117"]
33502 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
33503 #[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
33504 #[doc = ""]
33505 #[doc = "ID: 192"]
33506 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
33507 #[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
33508 #[doc = ""]
33509 #[doc = "ID: 69"]
33510 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
33511 #[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
33512 #[doc = ""]
33513 #[doc = "ID: 81"]
33514 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
33515 #[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33516 #[doc = ""]
33517 #[doc = "ID: 249"]
33518 MEMORY_VECT(MEMORY_VECT_DATA),
33519 #[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
33520 #[doc = ""]
33521 #[doc = "ID: 244"]
33522 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
33523 #[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
33524 #[doc = ""]
33525 #[doc = "ID: 47"]
33526 MISSION_ACK(MISSION_ACK_DATA),
33527 #[doc = "Delete all mission items at once."]
33528 #[doc = ""]
33529 #[doc = "ID: 45"]
33530 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
33531 #[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
33532 #[doc = ""]
33533 #[doc = "ID: 44"]
33534 MISSION_COUNT(MISSION_COUNT_DATA),
33535 #[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
33536 #[doc = ""]
33537 #[doc = "ID: 42"]
33538 MISSION_CURRENT(MISSION_CURRENT_DATA),
33539 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
33540 #[doc = ""]
33541 #[doc = "ID: 39"]
33542 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
33543 MISSION_ITEM(MISSION_ITEM_DATA),
33544 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
33545 #[doc = ""]
33546 #[doc = "ID: 73"]
33547 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
33548 #[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
33549 #[doc = ""]
33550 #[doc = "ID: 46"]
33551 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
33552 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
33553 #[doc = ""]
33554 #[doc = "ID: 40"]
33555 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
33556 MISSION_REQUEST(MISSION_REQUEST_DATA),
33557 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
33558 #[doc = ""]
33559 #[doc = "ID: 51"]
33560 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
33561 #[doc = "Request the overall list of mission items from the system/component."]
33562 #[doc = ""]
33563 #[doc = "ID: 43"]
33564 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
33565 #[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
33566 #[doc = ""]
33567 #[doc = "ID: 37"]
33568 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
33569 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
33570 #[doc = ""]
33571 #[doc = "ID: 41"]
33572 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
33573 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
33574 #[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
33575 #[doc = ""]
33576 #[doc = "ID: 38"]
33577 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
33578 #[doc = "Orientation of a mount."]
33579 #[doc = ""]
33580 #[doc = "ID: 265"]
33581 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
33582 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
33583 #[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33584 #[doc = ""]
33585 #[doc = "ID: 251"]
33586 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
33587 #[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
33588 #[doc = ""]
33589 #[doc = "ID: 252"]
33590 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
33591 #[doc = "The state of the navigation and position controller."]
33592 #[doc = ""]
33593 #[doc = "ID: 62"]
33594 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
33595 #[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
33596 #[doc = ""]
33597 #[doc = "ID: 330"]
33598 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
33599 #[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
33600 #[doc = ""]
33601 #[doc = "ID: 331"]
33602 ODOMETRY(ODOMETRY_DATA),
33603 #[doc = "Hardware status sent by an onboard computer."]
33604 #[doc = ""]
33605 #[doc = "ID: 390"]
33606 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
33607 #[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
33608 #[doc = ""]
33609 #[doc = "ID: 12918"]
33610 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
33611 #[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
33612 #[doc = ""]
33613 #[doc = "ID: 12902"]
33614 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
33615 #[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
33616 #[doc = ""]
33617 #[doc = "ID: 12900"]
33618 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
33619 #[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
33620 #[doc = ""]
33621 #[doc = "ID: 12901"]
33622 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
33623 #[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
33624 #[doc = ""]
33625 #[doc = "ID: 12915"]
33626 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
33627 #[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
33628 #[doc = ""]
33629 #[doc = "ID: 12905"]
33630 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
33631 #[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
33632 #[doc = ""]
33633 #[doc = "ID: 12903"]
33634 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
33635 #[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
33636 #[doc = ""]
33637 #[doc = "ID: 12904"]
33638 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
33639 #[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
33640 #[doc = ""]
33641 #[doc = "ID: 12919"]
33642 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
33643 #[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
33644 #[doc = ""]
33645 #[doc = "ID: 100"]
33646 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
33647 #[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
33648 #[doc = ""]
33649 #[doc = "ID: 106"]
33650 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
33651 #[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
33652 #[doc = ""]
33653 #[doc = "ID: 360"]
33654 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
33655 #[doc = "Response from a PARAM_EXT_SET message."]
33656 #[doc = ""]
33657 #[doc = "ID: 324"]
33658 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
33659 #[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
33660 #[doc = ""]
33661 #[doc = "ID: 321"]
33662 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
33663 #[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
33664 #[doc = ""]
33665 #[doc = "ID: 320"]
33666 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
33667 #[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
33668 #[doc = ""]
33669 #[doc = "ID: 323"]
33670 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
33671 #[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
33672 #[doc = ""]
33673 #[doc = "ID: 322"]
33674 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
33675 #[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
33676 #[doc = ""]
33677 #[doc = "ID: 50"]
33678 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
33679 #[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33680 #[doc = ""]
33681 #[doc = "ID: 21"]
33682 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
33683 #[doc = "Request to read the onboard parameter with the param_id string id. Onboard parameters are stored as key[const char*] ->value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
33684 #[doc = ""]
33685 #[doc = "ID: 20"]
33686 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
33687 #[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33688 #[doc = ""]
33689 #[doc = "ID: 23"]
33690 PARAM_SET(PARAM_SET_DATA),
33691 #[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
33692 #[doc = ""]
33693 #[doc = "ID: 22"]
33694 PARAM_VALUE(PARAM_VALUE_DATA),
33695 #[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
33696 #[doc = ""]
33697 #[doc = "ID: 4"]
33698 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
33699 PING(PING_DATA),
33700 #[doc = "Control vehicle tone generation (buzzer)."]
33701 #[doc = ""]
33702 #[doc = "ID: 258"]
33703 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
33704 PLAY_TUNE(PLAY_TUNE_DATA),
33705 #[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
33706 #[doc = ""]
33707 #[doc = "ID: 400"]
33708 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
33709 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
33710 #[doc = ""]
33711 #[doc = "ID: 87"]
33712 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
33713 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
33714 #[doc = ""]
33715 #[doc = "ID: 85"]
33716 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
33717 #[doc = "Power supply status."]
33718 #[doc = ""]
33719 #[doc = "ID: 125"]
33720 POWER_STATUS(POWER_STATUS_DATA),
33721 #[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
33722 #[doc = ""]
33723 #[doc = "ID: 300"]
33724 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
33725 #[doc = "Status generated by radio and injected into MAVLink stream."]
33726 #[doc = ""]
33727 #[doc = "ID: 109"]
33728 RADIO_STATUS(RADIO_STATUS_DATA),
33729 #[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
33730 #[doc = ""]
33731 #[doc = "ID: 27"]
33732 RAW_IMU(RAW_IMU_DATA),
33733 #[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
33734 #[doc = ""]
33735 #[doc = "ID: 28"]
33736 RAW_PRESSURE(RAW_PRESSURE_DATA),
33737 #[doc = "RPM sensor data message."]
33738 #[doc = ""]
33739 #[doc = "ID: 339"]
33740 RAW_RPM(RAW_RPM_DATA),
33741 #[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
33742 #[doc = ""]
33743 #[doc = "ID: 65"]
33744 RC_CHANNELS(RC_CHANNELS_DATA),
33745 #[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
33746 #[doc = ""]
33747 #[doc = "ID: 70"]
33748 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
33749 #[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
33750 #[doc = ""]
33751 #[doc = "ID: 35"]
33752 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
33753 #[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
33754 #[doc = ""]
33755 #[doc = "ID: 34"]
33756 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
33757 #[doc = "Request a data stream."]
33758 #[doc = ""]
33759 #[doc = "ID: 66"]
33760 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
33761 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
33762 #[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
33763 #[doc = ""]
33764 #[doc = "ID: 412"]
33765 REQUEST_EVENT(REQUEST_EVENT_DATA),
33766 #[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
33767 #[doc = ""]
33768 #[doc = "ID: 142"]
33769 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
33770 #[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
33771 #[doc = ""]
33772 #[doc = "ID: 413"]
33773 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
33774 #[doc = "Read out the safety zone the MAV currently assumes."]
33775 #[doc = ""]
33776 #[doc = "ID: 55"]
33777 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
33778 #[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
33779 #[doc = ""]
33780 #[doc = "ID: 54"]
33781 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
33782 #[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
33783 #[doc = ""]
33784 #[doc = "ID: 26"]
33785 SCALED_IMU(SCALED_IMU_DATA),
33786 #[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
33787 #[doc = ""]
33788 #[doc = "ID: 116"]
33789 SCALED_IMU2(SCALED_IMU2_DATA),
33790 #[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
33791 #[doc = ""]
33792 #[doc = "ID: 129"]
33793 SCALED_IMU3(SCALED_IMU3_DATA),
33794 #[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
33795 #[doc = ""]
33796 #[doc = "ID: 29"]
33797 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
33798 #[doc = "Barometer readings for 2nd barometer."]
33799 #[doc = ""]
33800 #[doc = "ID: 137"]
33801 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
33802 #[doc = "Barometer readings for 3rd barometer."]
33803 #[doc = ""]
33804 #[doc = "ID: 143"]
33805 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
33806 #[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
33807 #[doc = ""]
33808 #[doc = "ID: 126"]
33809 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
33810 #[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
33811 #[doc = ""]
33812 #[doc = "ID: 36"]
33813 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
33814 #[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
33815 #[doc = ""]
33816 #[doc = "ID: 256"]
33817 SETUP_SIGNING(SETUP_SIGNING_DATA),
33818 #[doc = "Set the vehicle attitude and body angular rates."]
33819 #[doc = ""]
33820 #[doc = "ID: 139"]
33821 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
33822 #[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
33823 #[doc = ""]
33824 #[doc = "ID: 82"]
33825 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
33826 #[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
33827 #[doc = ""]
33828 #[doc = "ID: 48"]
33829 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
33830 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
33831 #[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
33832 #[doc = ""]
33833 #[doc = "ID: 243"]
33834 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
33835 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
33836 #[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
33837 #[doc = ""]
33838 #[doc = "ID: 11"]
33839 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
33840 SET_MODE(SET_MODE_DATA),
33841 #[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
33842 #[doc = ""]
33843 #[doc = "ID: 86"]
33844 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
33845 #[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
33846 #[doc = ""]
33847 #[doc = "ID: 84"]
33848 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
33849 #[doc = "Status of simulation environment, if used."]
33850 #[doc = ""]
33851 #[doc = "ID: 108"]
33852 SIM_STATE(SIM_STATE_DATA),
33853 #[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
33854 #[doc = ""]
33855 #[doc = "ID: 370"]
33856 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
33857 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
33858 #[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
33859 #[doc = ""]
33860 #[doc = "ID: 253"]
33861 STATUSTEXT(STATUSTEXT_DATA),
33862 #[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
33863 #[doc = ""]
33864 #[doc = "ID: 261"]
33865 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
33866 #[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
33867 #[doc = ""]
33868 #[doc = "ID: 401"]
33869 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
33870 #[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
33871 #[doc = ""]
33872 #[doc = "ID: 2"]
33873 SYSTEM_TIME(SYSTEM_TIME_DATA),
33874 #[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
33875 #[doc = ""]
33876 #[doc = "ID: 1"]
33877 SYS_STATUS(SYS_STATUS_DATA),
33878 #[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
33879 #[doc = ""]
33880 #[doc = "ID: 135"]
33881 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
33882 #[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33883 #[doc = ""]
33884 #[doc = "ID: 134"]
33885 TERRAIN_DATA(TERRAIN_DATA_DATA),
33886 #[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33887 #[doc = ""]
33888 #[doc = "ID: 136"]
33889 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
33890 #[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
33891 #[doc = ""]
33892 #[doc = "ID: 133"]
33893 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
33894 #[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
33895 #[doc = ""]
33896 #[doc = "ID: 111"]
33897 TIMESYNC(TIMESYNC_DATA),
33898 #[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
33899 #[doc = ""]
33900 #[doc = "ID: 380"]
33901 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
33902 #[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
33903 #[doc = ""]
33904 #[doc = "ID: 333"]
33905 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
33906 #[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
33907 #[doc = ""]
33908 #[doc = "ID: 332"]
33909 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
33910 #[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
33911 #[doc = ""]
33912 #[doc = "ID: 385"]
33913 TUNNEL(TUNNEL_DATA),
33914 #[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
33915 #[doc = ""]
33916 #[doc = "ID: 311"]
33917 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
33918 #[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
33919 #[doc = ""]
33920 #[doc = "ID: 310"]
33921 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
33922 #[doc = "The global position resulting from GPS and sensor fusion."]
33923 #[doc = ""]
33924 #[doc = "ID: 340"]
33925 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
33926 #[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
33927 #[doc = ""]
33928 #[doc = "ID: 248"]
33929 V2_EXTENSION(V2_EXTENSION_DATA),
33930 #[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
33931 #[doc = ""]
33932 #[doc = "ID: 74"]
33933 VFR_HUD(VFR_HUD_DATA),
33934 #[doc = "Vibration levels and accelerometer clipping."]
33935 #[doc = ""]
33936 #[doc = "ID: 241"]
33937 VIBRATION(VIBRATION_DATA),
33938 #[doc = "Global position estimate from a Vicon motion system source."]
33939 #[doc = ""]
33940 #[doc = "ID: 104"]
33941 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
33942 #[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
33943 #[doc = ""]
33944 #[doc = "ID: 269"]
33945 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
33946 #[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
33947 #[doc = ""]
33948 #[doc = "ID: 270"]
33949 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
33950 #[doc = "Local position/attitude estimate from a vision source."]
33951 #[doc = ""]
33952 #[doc = "ID: 102"]
33953 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
33954 #[doc = "Speed estimate from a vision source."]
33955 #[doc = ""]
33956 #[doc = "ID: 103"]
33957 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
33958 #[doc = "Cumulative distance traveled for each reported wheel."]
33959 #[doc = ""]
33960 #[doc = "ID: 9000"]
33961 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
33962 #[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
33963 #[doc = ""]
33964 #[doc = "ID: 299"]
33965 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
33966 #[doc = "Winch status."]
33967 #[doc = ""]
33968 #[doc = "ID: 9005"]
33969 WINCH_STATUS(WINCH_STATUS_DATA),
33970 #[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
33971 #[doc = ""]
33972 #[doc = "ID: 231"]
33973 WIND_COV(WIND_COV_DATA),
33974}
33975impl MavMessage {
33976 pub const fn all_ids() -> &'static [u32] {
33977 &[
33978 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
33979 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
33980 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
33981 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
33982 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
33983 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
33984 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
33985 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
33986 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
33987 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
33988 148u32, 149u32, 162u32, 192u32, 225u32, 230u32, 231u32, 232u32, 233u32, 234u32, 235u32,
33989 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32, 249u32, 250u32, 251u32,
33990 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32, 261u32, 262u32, 263u32,
33991 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32, 275u32, 276u32, 277u32,
33992 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32, 288u32, 290u32, 291u32,
33993 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32, 323u32, 324u32, 330u32,
33994 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32, 350u32, 360u32, 370u32,
33995 371u32, 372u32, 373u32, 375u32, 380u32, 385u32, 386u32, 387u32, 388u32, 390u32, 395u32,
33996 396u32, 397u32, 400u32, 401u32, 410u32, 411u32, 412u32, 413u32, 435u32, 436u32, 437u32,
33997 440u32, 9000u32, 9005u32, 12900u32, 12901u32, 12902u32, 12903u32, 12904u32, 12905u32,
33998 12915u32, 12918u32, 12919u32, 12920u32, 17150u32, 17151u32, 17153u32, 17154u32,
33999 17155u32, 17156u32, 17157u32, 17158u32,
34000 ]
34001 }
34002 pub const fn all_messages() -> &'static [(&'static str, u32)] {
34003 &[
34004 (HEARTBEAT_DATA::NAME, HEARTBEAT_DATA::ID),
34005 (SYS_STATUS_DATA::NAME, SYS_STATUS_DATA::ID),
34006 (SYSTEM_TIME_DATA::NAME, SYSTEM_TIME_DATA::ID),
34007 (PING_DATA::NAME, PING_DATA::ID),
34008 (
34009 CHANGE_OPERATOR_CONTROL_DATA::NAME,
34010 CHANGE_OPERATOR_CONTROL_DATA::ID,
34011 ),
34012 (
34013 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
34014 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
34015 ),
34016 (AUTH_KEY_DATA::NAME, AUTH_KEY_DATA::ID),
34017 (LINK_NODE_STATUS_DATA::NAME, LINK_NODE_STATUS_DATA::ID),
34018 (SET_MODE_DATA::NAME, SET_MODE_DATA::ID),
34019 (PARAM_REQUEST_READ_DATA::NAME, PARAM_REQUEST_READ_DATA::ID),
34020 (PARAM_REQUEST_LIST_DATA::NAME, PARAM_REQUEST_LIST_DATA::ID),
34021 (PARAM_VALUE_DATA::NAME, PARAM_VALUE_DATA::ID),
34022 (PARAM_SET_DATA::NAME, PARAM_SET_DATA::ID),
34023 (GPS_RAW_INT_DATA::NAME, GPS_RAW_INT_DATA::ID),
34024 (GPS_STATUS_DATA::NAME, GPS_STATUS_DATA::ID),
34025 (SCALED_IMU_DATA::NAME, SCALED_IMU_DATA::ID),
34026 (RAW_IMU_DATA::NAME, RAW_IMU_DATA::ID),
34027 (RAW_PRESSURE_DATA::NAME, RAW_PRESSURE_DATA::ID),
34028 (SCALED_PRESSURE_DATA::NAME, SCALED_PRESSURE_DATA::ID),
34029 (ATTITUDE_DATA::NAME, ATTITUDE_DATA::ID),
34030 (ATTITUDE_QUATERNION_DATA::NAME, ATTITUDE_QUATERNION_DATA::ID),
34031 (LOCAL_POSITION_NED_DATA::NAME, LOCAL_POSITION_NED_DATA::ID),
34032 (GLOBAL_POSITION_INT_DATA::NAME, GLOBAL_POSITION_INT_DATA::ID),
34033 (RC_CHANNELS_SCALED_DATA::NAME, RC_CHANNELS_SCALED_DATA::ID),
34034 (RC_CHANNELS_RAW_DATA::NAME, RC_CHANNELS_RAW_DATA::ID),
34035 (SERVO_OUTPUT_RAW_DATA::NAME, SERVO_OUTPUT_RAW_DATA::ID),
34036 (
34037 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
34038 MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
34039 ),
34040 (
34041 MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
34042 MISSION_WRITE_PARTIAL_LIST_DATA::ID,
34043 ),
34044 (MISSION_ITEM_DATA::NAME, MISSION_ITEM_DATA::ID),
34045 (MISSION_REQUEST_DATA::NAME, MISSION_REQUEST_DATA::ID),
34046 (MISSION_SET_CURRENT_DATA::NAME, MISSION_SET_CURRENT_DATA::ID),
34047 (MISSION_CURRENT_DATA::NAME, MISSION_CURRENT_DATA::ID),
34048 (
34049 MISSION_REQUEST_LIST_DATA::NAME,
34050 MISSION_REQUEST_LIST_DATA::ID,
34051 ),
34052 (MISSION_COUNT_DATA::NAME, MISSION_COUNT_DATA::ID),
34053 (MISSION_CLEAR_ALL_DATA::NAME, MISSION_CLEAR_ALL_DATA::ID),
34054 (
34055 MISSION_ITEM_REACHED_DATA::NAME,
34056 MISSION_ITEM_REACHED_DATA::ID,
34057 ),
34058 (MISSION_ACK_DATA::NAME, MISSION_ACK_DATA::ID),
34059 (
34060 SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
34061 SET_GPS_GLOBAL_ORIGIN_DATA::ID,
34062 ),
34063 (GPS_GLOBAL_ORIGIN_DATA::NAME, GPS_GLOBAL_ORIGIN_DATA::ID),
34064 (PARAM_MAP_RC_DATA::NAME, PARAM_MAP_RC_DATA::ID),
34065 (MISSION_REQUEST_INT_DATA::NAME, MISSION_REQUEST_INT_DATA::ID),
34066 (
34067 SAFETY_SET_ALLOWED_AREA_DATA::NAME,
34068 SAFETY_SET_ALLOWED_AREA_DATA::ID,
34069 ),
34070 (SAFETY_ALLOWED_AREA_DATA::NAME, SAFETY_ALLOWED_AREA_DATA::ID),
34071 (
34072 ATTITUDE_QUATERNION_COV_DATA::NAME,
34073 ATTITUDE_QUATERNION_COV_DATA::ID,
34074 ),
34075 (
34076 NAV_CONTROLLER_OUTPUT_DATA::NAME,
34077 NAV_CONTROLLER_OUTPUT_DATA::ID,
34078 ),
34079 (
34080 GLOBAL_POSITION_INT_COV_DATA::NAME,
34081 GLOBAL_POSITION_INT_COV_DATA::ID,
34082 ),
34083 (
34084 LOCAL_POSITION_NED_COV_DATA::NAME,
34085 LOCAL_POSITION_NED_COV_DATA::ID,
34086 ),
34087 (RC_CHANNELS_DATA::NAME, RC_CHANNELS_DATA::ID),
34088 (REQUEST_DATA_STREAM_DATA::NAME, REQUEST_DATA_STREAM_DATA::ID),
34089 (DATA_STREAM_DATA::NAME, DATA_STREAM_DATA::ID),
34090 (MANUAL_CONTROL_DATA::NAME, MANUAL_CONTROL_DATA::ID),
34091 (
34092 RC_CHANNELS_OVERRIDE_DATA::NAME,
34093 RC_CHANNELS_OVERRIDE_DATA::ID,
34094 ),
34095 (MISSION_ITEM_INT_DATA::NAME, MISSION_ITEM_INT_DATA::ID),
34096 (VFR_HUD_DATA::NAME, VFR_HUD_DATA::ID),
34097 (COMMAND_INT_DATA::NAME, COMMAND_INT_DATA::ID),
34098 (COMMAND_LONG_DATA::NAME, COMMAND_LONG_DATA::ID),
34099 (COMMAND_ACK_DATA::NAME, COMMAND_ACK_DATA::ID),
34100 (COMMAND_CANCEL_DATA::NAME, COMMAND_CANCEL_DATA::ID),
34101 (MANUAL_SETPOINT_DATA::NAME, MANUAL_SETPOINT_DATA::ID),
34102 (SET_ATTITUDE_TARGET_DATA::NAME, SET_ATTITUDE_TARGET_DATA::ID),
34103 (ATTITUDE_TARGET_DATA::NAME, ATTITUDE_TARGET_DATA::ID),
34104 (
34105 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
34106 SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
34107 ),
34108 (
34109 POSITION_TARGET_LOCAL_NED_DATA::NAME,
34110 POSITION_TARGET_LOCAL_NED_DATA::ID,
34111 ),
34112 (
34113 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34114 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
34115 ),
34116 (
34117 POSITION_TARGET_GLOBAL_INT_DATA::NAME,
34118 POSITION_TARGET_GLOBAL_INT_DATA::ID,
34119 ),
34120 (
34121 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME,
34122 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID,
34123 ),
34124 (HIL_STATE_DATA::NAME, HIL_STATE_DATA::ID),
34125 (HIL_CONTROLS_DATA::NAME, HIL_CONTROLS_DATA::ID),
34126 (HIL_RC_INPUTS_RAW_DATA::NAME, HIL_RC_INPUTS_RAW_DATA::ID),
34127 (
34128 HIL_ACTUATOR_CONTROLS_DATA::NAME,
34129 HIL_ACTUATOR_CONTROLS_DATA::ID,
34130 ),
34131 (OPTICAL_FLOW_DATA::NAME, OPTICAL_FLOW_DATA::ID),
34132 (
34133 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
34134 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
34135 ),
34136 (
34137 VISION_POSITION_ESTIMATE_DATA::NAME,
34138 VISION_POSITION_ESTIMATE_DATA::ID,
34139 ),
34140 (
34141 VISION_SPEED_ESTIMATE_DATA::NAME,
34142 VISION_SPEED_ESTIMATE_DATA::ID,
34143 ),
34144 (
34145 VICON_POSITION_ESTIMATE_DATA::NAME,
34146 VICON_POSITION_ESTIMATE_DATA::ID,
34147 ),
34148 (HIGHRES_IMU_DATA::NAME, HIGHRES_IMU_DATA::ID),
34149 (OPTICAL_FLOW_RAD_DATA::NAME, OPTICAL_FLOW_RAD_DATA::ID),
34150 (HIL_SENSOR_DATA::NAME, HIL_SENSOR_DATA::ID),
34151 (SIM_STATE_DATA::NAME, SIM_STATE_DATA::ID),
34152 (RADIO_STATUS_DATA::NAME, RADIO_STATUS_DATA::ID),
34153 (
34154 FILE_TRANSFER_PROTOCOL_DATA::NAME,
34155 FILE_TRANSFER_PROTOCOL_DATA::ID,
34156 ),
34157 (TIMESYNC_DATA::NAME, TIMESYNC_DATA::ID),
34158 (CAMERA_TRIGGER_DATA::NAME, CAMERA_TRIGGER_DATA::ID),
34159 (HIL_GPS_DATA::NAME, HIL_GPS_DATA::ID),
34160 (HIL_OPTICAL_FLOW_DATA::NAME, HIL_OPTICAL_FLOW_DATA::ID),
34161 (
34162 HIL_STATE_QUATERNION_DATA::NAME,
34163 HIL_STATE_QUATERNION_DATA::ID,
34164 ),
34165 (SCALED_IMU2_DATA::NAME, SCALED_IMU2_DATA::ID),
34166 (LOG_REQUEST_LIST_DATA::NAME, LOG_REQUEST_LIST_DATA::ID),
34167 (LOG_ENTRY_DATA::NAME, LOG_ENTRY_DATA::ID),
34168 (LOG_REQUEST_DATA_DATA::NAME, LOG_REQUEST_DATA_DATA::ID),
34169 (LOG_DATA_DATA::NAME, LOG_DATA_DATA::ID),
34170 (LOG_ERASE_DATA::NAME, LOG_ERASE_DATA::ID),
34171 (LOG_REQUEST_END_DATA::NAME, LOG_REQUEST_END_DATA::ID),
34172 (GPS_INJECT_DATA_DATA::NAME, GPS_INJECT_DATA_DATA::ID),
34173 (GPS2_RAW_DATA::NAME, GPS2_RAW_DATA::ID),
34174 (POWER_STATUS_DATA::NAME, POWER_STATUS_DATA::ID),
34175 (SERIAL_CONTROL_DATA::NAME, SERIAL_CONTROL_DATA::ID),
34176 (GPS_RTK_DATA::NAME, GPS_RTK_DATA::ID),
34177 (GPS2_RTK_DATA::NAME, GPS2_RTK_DATA::ID),
34178 (SCALED_IMU3_DATA::NAME, SCALED_IMU3_DATA::ID),
34179 (
34180 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
34181 DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
34182 ),
34183 (ENCAPSULATED_DATA_DATA::NAME, ENCAPSULATED_DATA_DATA::ID),
34184 (DISTANCE_SENSOR_DATA::NAME, DISTANCE_SENSOR_DATA::ID),
34185 (TERRAIN_REQUEST_DATA::NAME, TERRAIN_REQUEST_DATA::ID),
34186 (TERRAIN_DATA_DATA::NAME, TERRAIN_DATA_DATA::ID),
34187 (TERRAIN_CHECK_DATA::NAME, TERRAIN_CHECK_DATA::ID),
34188 (TERRAIN_REPORT_DATA::NAME, TERRAIN_REPORT_DATA::ID),
34189 (SCALED_PRESSURE2_DATA::NAME, SCALED_PRESSURE2_DATA::ID),
34190 (ATT_POS_MOCAP_DATA::NAME, ATT_POS_MOCAP_DATA::ID),
34191 (
34192 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
34193 SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
34194 ),
34195 (
34196 ACTUATOR_CONTROL_TARGET_DATA::NAME,
34197 ACTUATOR_CONTROL_TARGET_DATA::ID,
34198 ),
34199 (ALTITUDE_DATA::NAME, ALTITUDE_DATA::ID),
34200 (RESOURCE_REQUEST_DATA::NAME, RESOURCE_REQUEST_DATA::ID),
34201 (SCALED_PRESSURE3_DATA::NAME, SCALED_PRESSURE3_DATA::ID),
34202 (FOLLOW_TARGET_DATA::NAME, FOLLOW_TARGET_DATA::ID),
34203 (
34204 CONTROL_SYSTEM_STATE_DATA::NAME,
34205 CONTROL_SYSTEM_STATE_DATA::ID,
34206 ),
34207 (BATTERY_STATUS_DATA::NAME, BATTERY_STATUS_DATA::ID),
34208 (AUTOPILOT_VERSION_DATA::NAME, AUTOPILOT_VERSION_DATA::ID),
34209 (LANDING_TARGET_DATA::NAME, LANDING_TARGET_DATA::ID),
34210 (FENCE_STATUS_DATA::NAME, FENCE_STATUS_DATA::ID),
34211 (MAG_CAL_REPORT_DATA::NAME, MAG_CAL_REPORT_DATA::ID),
34212 (EFI_STATUS_DATA::NAME, EFI_STATUS_DATA::ID),
34213 (ESTIMATOR_STATUS_DATA::NAME, ESTIMATOR_STATUS_DATA::ID),
34214 (WIND_COV_DATA::NAME, WIND_COV_DATA::ID),
34215 (GPS_INPUT_DATA::NAME, GPS_INPUT_DATA::ID),
34216 (GPS_RTCM_DATA_DATA::NAME, GPS_RTCM_DATA_DATA::ID),
34217 (HIGH_LATENCY_DATA::NAME, HIGH_LATENCY_DATA::ID),
34218 (HIGH_LATENCY2_DATA::NAME, HIGH_LATENCY2_DATA::ID),
34219 (VIBRATION_DATA::NAME, VIBRATION_DATA::ID),
34220 (HOME_POSITION_DATA::NAME, HOME_POSITION_DATA::ID),
34221 (SET_HOME_POSITION_DATA::NAME, SET_HOME_POSITION_DATA::ID),
34222 (MESSAGE_INTERVAL_DATA::NAME, MESSAGE_INTERVAL_DATA::ID),
34223 (EXTENDED_SYS_STATE_DATA::NAME, EXTENDED_SYS_STATE_DATA::ID),
34224 (ADSB_VEHICLE_DATA::NAME, ADSB_VEHICLE_DATA::ID),
34225 (COLLISION_DATA::NAME, COLLISION_DATA::ID),
34226 (V2_EXTENSION_DATA::NAME, V2_EXTENSION_DATA::ID),
34227 (MEMORY_VECT_DATA::NAME, MEMORY_VECT_DATA::ID),
34228 (DEBUG_VECT_DATA::NAME, DEBUG_VECT_DATA::ID),
34229 (NAMED_VALUE_FLOAT_DATA::NAME, NAMED_VALUE_FLOAT_DATA::ID),
34230 (NAMED_VALUE_INT_DATA::NAME, NAMED_VALUE_INT_DATA::ID),
34231 (STATUSTEXT_DATA::NAME, STATUSTEXT_DATA::ID),
34232 (DEBUG_DATA::NAME, DEBUG_DATA::ID),
34233 (SETUP_SIGNING_DATA::NAME, SETUP_SIGNING_DATA::ID),
34234 (BUTTON_CHANGE_DATA::NAME, BUTTON_CHANGE_DATA::ID),
34235 (PLAY_TUNE_DATA::NAME, PLAY_TUNE_DATA::ID),
34236 (CAMERA_INFORMATION_DATA::NAME, CAMERA_INFORMATION_DATA::ID),
34237 (CAMERA_SETTINGS_DATA::NAME, CAMERA_SETTINGS_DATA::ID),
34238 (STORAGE_INFORMATION_DATA::NAME, STORAGE_INFORMATION_DATA::ID),
34239 (
34240 CAMERA_CAPTURE_STATUS_DATA::NAME,
34241 CAMERA_CAPTURE_STATUS_DATA::ID,
34242 ),
34243 (
34244 CAMERA_IMAGE_CAPTURED_DATA::NAME,
34245 CAMERA_IMAGE_CAPTURED_DATA::ID,
34246 ),
34247 (FLIGHT_INFORMATION_DATA::NAME, FLIGHT_INFORMATION_DATA::ID),
34248 (MOUNT_ORIENTATION_DATA::NAME, MOUNT_ORIENTATION_DATA::ID),
34249 (LOGGING_DATA_DATA::NAME, LOGGING_DATA_DATA::ID),
34250 (LOGGING_DATA_ACKED_DATA::NAME, LOGGING_DATA_ACKED_DATA::ID),
34251 (LOGGING_ACK_DATA::NAME, LOGGING_ACK_DATA::ID),
34252 (
34253 VIDEO_STREAM_INFORMATION_DATA::NAME,
34254 VIDEO_STREAM_INFORMATION_DATA::ID,
34255 ),
34256 (VIDEO_STREAM_STATUS_DATA::NAME, VIDEO_STREAM_STATUS_DATA::ID),
34257 (CAMERA_FOV_STATUS_DATA::NAME, CAMERA_FOV_STATUS_DATA::ID),
34258 (
34259 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
34260 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
34261 ),
34262 (
34263 CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
34264 CAMERA_TRACKING_GEO_STATUS_DATA::ID,
34265 ),
34266 (
34267 CAMERA_THERMAL_RANGE_DATA::NAME,
34268 CAMERA_THERMAL_RANGE_DATA::ID,
34269 ),
34270 (
34271 GIMBAL_MANAGER_INFORMATION_DATA::NAME,
34272 GIMBAL_MANAGER_INFORMATION_DATA::ID,
34273 ),
34274 (
34275 GIMBAL_MANAGER_STATUS_DATA::NAME,
34276 GIMBAL_MANAGER_STATUS_DATA::ID,
34277 ),
34278 (
34279 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
34280 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
34281 ),
34282 (
34283 GIMBAL_DEVICE_INFORMATION_DATA::NAME,
34284 GIMBAL_DEVICE_INFORMATION_DATA::ID,
34285 ),
34286 (
34287 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
34288 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
34289 ),
34290 (
34291 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
34292 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
34293 ),
34294 (
34295 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME,
34296 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID,
34297 ),
34298 (
34299 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
34300 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
34301 ),
34302 (
34303 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME,
34304 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID,
34305 ),
34306 (ESC_INFO_DATA::NAME, ESC_INFO_DATA::ID),
34307 (ESC_STATUS_DATA::NAME, ESC_STATUS_DATA::ID),
34308 (WIFI_CONFIG_AP_DATA::NAME, WIFI_CONFIG_AP_DATA::ID),
34309 (PROTOCOL_VERSION_DATA::NAME, PROTOCOL_VERSION_DATA::ID),
34310 (AIS_VESSEL_DATA::NAME, AIS_VESSEL_DATA::ID),
34311 (UAVCAN_NODE_STATUS_DATA::NAME, UAVCAN_NODE_STATUS_DATA::ID),
34312 (UAVCAN_NODE_INFO_DATA::NAME, UAVCAN_NODE_INFO_DATA::ID),
34313 (
34314 PARAM_EXT_REQUEST_READ_DATA::NAME,
34315 PARAM_EXT_REQUEST_READ_DATA::ID,
34316 ),
34317 (
34318 PARAM_EXT_REQUEST_LIST_DATA::NAME,
34319 PARAM_EXT_REQUEST_LIST_DATA::ID,
34320 ),
34321 (PARAM_EXT_VALUE_DATA::NAME, PARAM_EXT_VALUE_DATA::ID),
34322 (PARAM_EXT_SET_DATA::NAME, PARAM_EXT_SET_DATA::ID),
34323 (PARAM_EXT_ACK_DATA::NAME, PARAM_EXT_ACK_DATA::ID),
34324 (OBSTACLE_DISTANCE_DATA::NAME, OBSTACLE_DISTANCE_DATA::ID),
34325 (ODOMETRY_DATA::NAME, ODOMETRY_DATA::ID),
34326 (
34327 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME,
34328 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID,
34329 ),
34330 (
34331 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME,
34332 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
34333 ),
34334 (CELLULAR_STATUS_DATA::NAME, CELLULAR_STATUS_DATA::ID),
34335 (ISBD_LINK_STATUS_DATA::NAME, ISBD_LINK_STATUS_DATA::ID),
34336 (CELLULAR_CONFIG_DATA::NAME, CELLULAR_CONFIG_DATA::ID),
34337 (RAW_RPM_DATA::NAME, RAW_RPM_DATA::ID),
34338 (UTM_GLOBAL_POSITION_DATA::NAME, UTM_GLOBAL_POSITION_DATA::ID),
34339 (DEBUG_FLOAT_ARRAY_DATA::NAME, DEBUG_FLOAT_ARRAY_DATA::ID),
34340 (
34341 ORBIT_EXECUTION_STATUS_DATA::NAME,
34342 ORBIT_EXECUTION_STATUS_DATA::ID,
34343 ),
34344 (SMART_BATTERY_INFO_DATA::NAME, SMART_BATTERY_INFO_DATA::ID),
34345 (FUEL_STATUS_DATA::NAME, FUEL_STATUS_DATA::ID),
34346 (BATTERY_INFO_DATA::NAME, BATTERY_INFO_DATA::ID),
34347 (GENERATOR_STATUS_DATA::NAME, GENERATOR_STATUS_DATA::ID),
34348 (
34349 ACTUATOR_OUTPUT_STATUS_DATA::NAME,
34350 ACTUATOR_OUTPUT_STATUS_DATA::ID,
34351 ),
34352 (
34353 TIME_ESTIMATE_TO_TARGET_DATA::NAME,
34354 TIME_ESTIMATE_TO_TARGET_DATA::ID,
34355 ),
34356 (TUNNEL_DATA::NAME, TUNNEL_DATA::ID),
34357 (CAN_FRAME_DATA::NAME, CAN_FRAME_DATA::ID),
34358 (CANFD_FRAME_DATA::NAME, CANFD_FRAME_DATA::ID),
34359 (CAN_FILTER_MODIFY_DATA::NAME, CAN_FILTER_MODIFY_DATA::ID),
34360 (
34361 ONBOARD_COMPUTER_STATUS_DATA::NAME,
34362 ONBOARD_COMPUTER_STATUS_DATA::ID,
34363 ),
34364 (
34365 COMPONENT_INFORMATION_DATA::NAME,
34366 COMPONENT_INFORMATION_DATA::ID,
34367 ),
34368 (
34369 COMPONENT_INFORMATION_BASIC_DATA::NAME,
34370 COMPONENT_INFORMATION_BASIC_DATA::ID,
34371 ),
34372 (COMPONENT_METADATA_DATA::NAME, COMPONENT_METADATA_DATA::ID),
34373 (PLAY_TUNE_V2_DATA::NAME, PLAY_TUNE_V2_DATA::ID),
34374 (SUPPORTED_TUNES_DATA::NAME, SUPPORTED_TUNES_DATA::ID),
34375 (EVENT_DATA::NAME, EVENT_DATA::ID),
34376 (
34377 CURRENT_EVENT_SEQUENCE_DATA::NAME,
34378 CURRENT_EVENT_SEQUENCE_DATA::ID,
34379 ),
34380 (REQUEST_EVENT_DATA::NAME, REQUEST_EVENT_DATA::ID),
34381 (
34382 RESPONSE_EVENT_ERROR_DATA::NAME,
34383 RESPONSE_EVENT_ERROR_DATA::ID,
34384 ),
34385 (AVAILABLE_MODES_DATA::NAME, AVAILABLE_MODES_DATA::ID),
34386 (CURRENT_MODE_DATA::NAME, CURRENT_MODE_DATA::ID),
34387 (
34388 AVAILABLE_MODES_MONITOR_DATA::NAME,
34389 AVAILABLE_MODES_MONITOR_DATA::ID,
34390 ),
34391 (ILLUMINATOR_STATUS_DATA::NAME, ILLUMINATOR_STATUS_DATA::ID),
34392 (WHEEL_DISTANCE_DATA::NAME, WHEEL_DISTANCE_DATA::ID),
34393 (WINCH_STATUS_DATA::NAME, WINCH_STATUS_DATA::ID),
34394 (
34395 OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
34396 OPEN_DRONE_ID_BASIC_ID_DATA::ID,
34397 ),
34398 (
34399 OPEN_DRONE_ID_LOCATION_DATA::NAME,
34400 OPEN_DRONE_ID_LOCATION_DATA::ID,
34401 ),
34402 (
34403 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
34404 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
34405 ),
34406 (
34407 OPEN_DRONE_ID_SELF_ID_DATA::NAME,
34408 OPEN_DRONE_ID_SELF_ID_DATA::ID,
34409 ),
34410 (
34411 OPEN_DRONE_ID_SYSTEM_DATA::NAME,
34412 OPEN_DRONE_ID_SYSTEM_DATA::ID,
34413 ),
34414 (
34415 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
34416 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
34417 ),
34418 (
34419 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
34420 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
34421 ),
34422 (
34423 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
34424 OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
34425 ),
34426 (
34427 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
34428 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
34429 ),
34430 (HYGROMETER_SENSOR_DATA::NAME, HYGROMETER_SENSOR_DATA::ID),
34431 (ARRAY_TEST_0_DATA::NAME, ARRAY_TEST_0_DATA::ID),
34432 (ARRAY_TEST_1_DATA::NAME, ARRAY_TEST_1_DATA::ID),
34433 (ARRAY_TEST_3_DATA::NAME, ARRAY_TEST_3_DATA::ID),
34434 (ARRAY_TEST_4_DATA::NAME, ARRAY_TEST_4_DATA::ID),
34435 (ARRAY_TEST_5_DATA::NAME, ARRAY_TEST_5_DATA::ID),
34436 (ARRAY_TEST_6_DATA::NAME, ARRAY_TEST_6_DATA::ID),
34437 (ARRAY_TEST_7_DATA::NAME, ARRAY_TEST_7_DATA::ID),
34438 (ARRAY_TEST_8_DATA::NAME, ARRAY_TEST_8_DATA::ID),
34439 ]
34440 }
34441}
34442impl Message for MavMessage {
34443 fn parse(
34444 version: MavlinkVersion,
34445 id: u32,
34446 payload: &[u8],
34447 ) -> Result<Self, ::mavlink_core::error::ParserError> {
34448 match id {
34449 ACTUATOR_CONTROL_TARGET_DATA::ID => {
34450 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
34451 .map(Self::ACTUATOR_CONTROL_TARGET)
34452 }
34453 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
34454 .map(Self::ACTUATOR_OUTPUT_STATUS),
34455 ADSB_VEHICLE_DATA::ID => {
34456 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
34457 }
34458 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
34459 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
34460 ARRAY_TEST_0_DATA::ID => {
34461 ARRAY_TEST_0_DATA::deser(version, payload).map(Self::ARRAY_TEST_0)
34462 }
34463 ARRAY_TEST_1_DATA::ID => {
34464 ARRAY_TEST_1_DATA::deser(version, payload).map(Self::ARRAY_TEST_1)
34465 }
34466 ARRAY_TEST_3_DATA::ID => {
34467 ARRAY_TEST_3_DATA::deser(version, payload).map(Self::ARRAY_TEST_3)
34468 }
34469 ARRAY_TEST_4_DATA::ID => {
34470 ARRAY_TEST_4_DATA::deser(version, payload).map(Self::ARRAY_TEST_4)
34471 }
34472 ARRAY_TEST_5_DATA::ID => {
34473 ARRAY_TEST_5_DATA::deser(version, payload).map(Self::ARRAY_TEST_5)
34474 }
34475 ARRAY_TEST_6_DATA::ID => {
34476 ARRAY_TEST_6_DATA::deser(version, payload).map(Self::ARRAY_TEST_6)
34477 }
34478 ARRAY_TEST_7_DATA::ID => {
34479 ARRAY_TEST_7_DATA::deser(version, payload).map(Self::ARRAY_TEST_7)
34480 }
34481 ARRAY_TEST_8_DATA::ID => {
34482 ARRAY_TEST_8_DATA::deser(version, payload).map(Self::ARRAY_TEST_8)
34483 }
34484 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
34485 ATTITUDE_QUATERNION_DATA::ID => {
34486 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
34487 }
34488 ATTITUDE_QUATERNION_COV_DATA::ID => {
34489 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
34490 .map(Self::ATTITUDE_QUATERNION_COV)
34491 }
34492 ATTITUDE_TARGET_DATA::ID => {
34493 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
34494 }
34495 ATT_POS_MOCAP_DATA::ID => {
34496 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
34497 }
34498 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
34499 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34500 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
34501 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
34502 }
34503 AUTOPILOT_VERSION_DATA::ID => {
34504 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
34505 }
34506 AVAILABLE_MODES_DATA::ID => {
34507 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
34508 }
34509 AVAILABLE_MODES_MONITOR_DATA::ID => {
34510 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
34511 .map(Self::AVAILABLE_MODES_MONITOR)
34512 }
34513 BATTERY_INFO_DATA::ID => {
34514 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
34515 }
34516 BATTERY_STATUS_DATA::ID => {
34517 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
34518 }
34519 BUTTON_CHANGE_DATA::ID => {
34520 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
34521 }
34522 CAMERA_CAPTURE_STATUS_DATA::ID => {
34523 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
34524 }
34525 CAMERA_FOV_STATUS_DATA::ID => {
34526 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
34527 }
34528 CAMERA_IMAGE_CAPTURED_DATA::ID => {
34529 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
34530 }
34531 CAMERA_INFORMATION_DATA::ID => {
34532 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
34533 }
34534 CAMERA_SETTINGS_DATA::ID => {
34535 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
34536 }
34537 CAMERA_THERMAL_RANGE_DATA::ID => {
34538 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
34539 }
34540 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
34541 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
34542 .map(Self::CAMERA_TRACKING_GEO_STATUS)
34543 }
34544 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
34545 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
34546 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
34547 }
34548 CAMERA_TRIGGER_DATA::ID => {
34549 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
34550 }
34551 CANFD_FRAME_DATA::ID => {
34552 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
34553 }
34554 CAN_FILTER_MODIFY_DATA::ID => {
34555 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
34556 }
34557 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
34558 CELLULAR_CONFIG_DATA::ID => {
34559 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
34560 }
34561 CELLULAR_STATUS_DATA::ID => {
34562 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
34563 }
34564 CHANGE_OPERATOR_CONTROL_DATA::ID => {
34565 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
34566 .map(Self::CHANGE_OPERATOR_CONTROL)
34567 }
34568 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
34569 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
34570 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
34571 }
34572 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
34573 COMMAND_ACK_DATA::ID => {
34574 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
34575 }
34576 COMMAND_CANCEL_DATA::ID => {
34577 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
34578 }
34579 COMMAND_INT_DATA::ID => {
34580 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
34581 }
34582 COMMAND_LONG_DATA::ID => {
34583 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
34584 }
34585 COMPONENT_INFORMATION_DATA::ID => {
34586 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
34587 }
34588 COMPONENT_INFORMATION_BASIC_DATA::ID => {
34589 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
34590 .map(Self::COMPONENT_INFORMATION_BASIC)
34591 }
34592 COMPONENT_METADATA_DATA::ID => {
34593 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
34594 }
34595 CONTROL_SYSTEM_STATE_DATA::ID => {
34596 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
34597 }
34598 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
34599 .map(Self::CURRENT_EVENT_SEQUENCE),
34600 CURRENT_MODE_DATA::ID => {
34601 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
34602 }
34603 DATA_STREAM_DATA::ID => {
34604 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
34605 }
34606 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
34607 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
34608 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
34609 }
34610 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
34611 DEBUG_FLOAT_ARRAY_DATA::ID => {
34612 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
34613 }
34614 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
34615 DISTANCE_SENSOR_DATA::ID => {
34616 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
34617 }
34618 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
34619 ENCAPSULATED_DATA_DATA::ID => {
34620 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
34621 }
34622 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
34623 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
34624 ESTIMATOR_STATUS_DATA::ID => {
34625 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
34626 }
34627 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
34628 EXTENDED_SYS_STATE_DATA::ID => {
34629 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
34630 }
34631 FENCE_STATUS_DATA::ID => {
34632 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
34633 }
34634 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
34635 .map(Self::FILE_TRANSFER_PROTOCOL),
34636 FLIGHT_INFORMATION_DATA::ID => {
34637 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
34638 }
34639 FOLLOW_TARGET_DATA::ID => {
34640 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
34641 }
34642 FUEL_STATUS_DATA::ID => {
34643 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
34644 }
34645 GENERATOR_STATUS_DATA::ID => {
34646 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
34647 }
34648 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
34649 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
34650 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
34651 }
34652 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
34653 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
34654 .map(Self::GIMBAL_DEVICE_INFORMATION)
34655 }
34656 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
34657 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
34658 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
34659 }
34660 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
34661 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
34662 .map(Self::GIMBAL_MANAGER_INFORMATION)
34663 }
34664 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
34665 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
34666 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
34667 }
34668 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34669 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
34670 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
34671 }
34672 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
34673 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
34674 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
34675 }
34676 GIMBAL_MANAGER_STATUS_DATA::ID => {
34677 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
34678 }
34679 GLOBAL_POSITION_INT_DATA::ID => {
34680 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
34681 }
34682 GLOBAL_POSITION_INT_COV_DATA::ID => {
34683 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
34684 .map(Self::GLOBAL_POSITION_INT_COV)
34685 }
34686 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34687 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
34688 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
34689 }
34690 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
34691 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
34692 GPS_GLOBAL_ORIGIN_DATA::ID => {
34693 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
34694 }
34695 GPS_INJECT_DATA_DATA::ID => {
34696 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
34697 }
34698 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
34699 GPS_RAW_INT_DATA::ID => {
34700 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
34701 }
34702 GPS_RTCM_DATA_DATA::ID => {
34703 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
34704 }
34705 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
34706 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
34707 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
34708 HIGHRES_IMU_DATA::ID => {
34709 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
34710 }
34711 HIGH_LATENCY_DATA::ID => {
34712 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
34713 }
34714 HIGH_LATENCY2_DATA::ID => {
34715 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
34716 }
34717 HIL_ACTUATOR_CONTROLS_DATA::ID => {
34718 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
34719 }
34720 HIL_CONTROLS_DATA::ID => {
34721 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
34722 }
34723 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
34724 HIL_OPTICAL_FLOW_DATA::ID => {
34725 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
34726 }
34727 HIL_RC_INPUTS_RAW_DATA::ID => {
34728 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
34729 }
34730 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
34731 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
34732 HIL_STATE_QUATERNION_DATA::ID => {
34733 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
34734 }
34735 HOME_POSITION_DATA::ID => {
34736 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
34737 }
34738 HYGROMETER_SENSOR_DATA::ID => {
34739 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
34740 }
34741 ILLUMINATOR_STATUS_DATA::ID => {
34742 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
34743 }
34744 ISBD_LINK_STATUS_DATA::ID => {
34745 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
34746 }
34747 LANDING_TARGET_DATA::ID => {
34748 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
34749 }
34750 LINK_NODE_STATUS_DATA::ID => {
34751 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
34752 }
34753 LOCAL_POSITION_NED_DATA::ID => {
34754 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
34755 }
34756 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
34757 .map(Self::LOCAL_POSITION_NED_COV),
34758 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
34759 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
34760 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
34761 }
34762 LOGGING_ACK_DATA::ID => {
34763 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
34764 }
34765 LOGGING_DATA_DATA::ID => {
34766 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
34767 }
34768 LOGGING_DATA_ACKED_DATA::ID => {
34769 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
34770 }
34771 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
34772 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
34773 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
34774 LOG_REQUEST_DATA_DATA::ID => {
34775 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
34776 }
34777 LOG_REQUEST_END_DATA::ID => {
34778 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
34779 }
34780 LOG_REQUEST_LIST_DATA::ID => {
34781 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
34782 }
34783 MAG_CAL_REPORT_DATA::ID => {
34784 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
34785 }
34786 MANUAL_CONTROL_DATA::ID => {
34787 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
34788 }
34789 MANUAL_SETPOINT_DATA::ID => {
34790 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
34791 }
34792 MEMORY_VECT_DATA::ID => {
34793 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
34794 }
34795 MESSAGE_INTERVAL_DATA::ID => {
34796 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
34797 }
34798 MISSION_ACK_DATA::ID => {
34799 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
34800 }
34801 MISSION_CLEAR_ALL_DATA::ID => {
34802 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
34803 }
34804 MISSION_COUNT_DATA::ID => {
34805 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
34806 }
34807 MISSION_CURRENT_DATA::ID => {
34808 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
34809 }
34810 MISSION_ITEM_DATA::ID => {
34811 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
34812 }
34813 MISSION_ITEM_INT_DATA::ID => {
34814 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
34815 }
34816 MISSION_ITEM_REACHED_DATA::ID => {
34817 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
34818 }
34819 MISSION_REQUEST_DATA::ID => {
34820 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
34821 }
34822 MISSION_REQUEST_INT_DATA::ID => {
34823 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
34824 }
34825 MISSION_REQUEST_LIST_DATA::ID => {
34826 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
34827 }
34828 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
34829 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
34830 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
34831 }
34832 MISSION_SET_CURRENT_DATA::ID => {
34833 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
34834 }
34835 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
34836 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
34837 .map(Self::MISSION_WRITE_PARTIAL_LIST)
34838 }
34839 MOUNT_ORIENTATION_DATA::ID => {
34840 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
34841 }
34842 NAMED_VALUE_FLOAT_DATA::ID => {
34843 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
34844 }
34845 NAMED_VALUE_INT_DATA::ID => {
34846 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
34847 }
34848 NAV_CONTROLLER_OUTPUT_DATA::ID => {
34849 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
34850 }
34851 OBSTACLE_DISTANCE_DATA::ID => {
34852 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
34853 }
34854 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
34855 ONBOARD_COMPUTER_STATUS_DATA::ID => {
34856 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
34857 .map(Self::ONBOARD_COMPUTER_STATUS)
34858 }
34859 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
34860 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
34861 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
34862 }
34863 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
34864 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
34865 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
34866 }
34867 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
34868 .map(Self::OPEN_DRONE_ID_BASIC_ID),
34869 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
34870 .map(Self::OPEN_DRONE_ID_LOCATION),
34871 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
34872 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
34873 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
34874 }
34875 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
34876 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
34877 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
34878 }
34879 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
34880 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
34881 }
34882 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
34883 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
34884 }
34885 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
34886 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
34887 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
34888 }
34889 OPTICAL_FLOW_DATA::ID => {
34890 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
34891 }
34892 OPTICAL_FLOW_RAD_DATA::ID => {
34893 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
34894 }
34895 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
34896 .map(Self::ORBIT_EXECUTION_STATUS),
34897 PARAM_EXT_ACK_DATA::ID => {
34898 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
34899 }
34900 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
34901 .map(Self::PARAM_EXT_REQUEST_LIST),
34902 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
34903 .map(Self::PARAM_EXT_REQUEST_READ),
34904 PARAM_EXT_SET_DATA::ID => {
34905 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
34906 }
34907 PARAM_EXT_VALUE_DATA::ID => {
34908 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
34909 }
34910 PARAM_MAP_RC_DATA::ID => {
34911 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
34912 }
34913 PARAM_REQUEST_LIST_DATA::ID => {
34914 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
34915 }
34916 PARAM_REQUEST_READ_DATA::ID => {
34917 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
34918 }
34919 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
34920 PARAM_VALUE_DATA::ID => {
34921 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
34922 }
34923 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
34924 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
34925 PLAY_TUNE_V2_DATA::ID => {
34926 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
34927 }
34928 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
34929 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
34930 .map(Self::POSITION_TARGET_GLOBAL_INT)
34931 }
34932 POSITION_TARGET_LOCAL_NED_DATA::ID => {
34933 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
34934 .map(Self::POSITION_TARGET_LOCAL_NED)
34935 }
34936 POWER_STATUS_DATA::ID => {
34937 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
34938 }
34939 PROTOCOL_VERSION_DATA::ID => {
34940 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
34941 }
34942 RADIO_STATUS_DATA::ID => {
34943 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
34944 }
34945 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
34946 RAW_PRESSURE_DATA::ID => {
34947 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
34948 }
34949 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
34950 RC_CHANNELS_DATA::ID => {
34951 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
34952 }
34953 RC_CHANNELS_OVERRIDE_DATA::ID => {
34954 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
34955 }
34956 RC_CHANNELS_RAW_DATA::ID => {
34957 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
34958 }
34959 RC_CHANNELS_SCALED_DATA::ID => {
34960 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
34961 }
34962 REQUEST_DATA_STREAM_DATA::ID => {
34963 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
34964 }
34965 REQUEST_EVENT_DATA::ID => {
34966 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
34967 }
34968 RESOURCE_REQUEST_DATA::ID => {
34969 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
34970 }
34971 RESPONSE_EVENT_ERROR_DATA::ID => {
34972 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
34973 }
34974 SAFETY_ALLOWED_AREA_DATA::ID => {
34975 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
34976 }
34977 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
34978 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
34979 .map(Self::SAFETY_SET_ALLOWED_AREA)
34980 }
34981 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
34982 SCALED_IMU2_DATA::ID => {
34983 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
34984 }
34985 SCALED_IMU3_DATA::ID => {
34986 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
34987 }
34988 SCALED_PRESSURE_DATA::ID => {
34989 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
34990 }
34991 SCALED_PRESSURE2_DATA::ID => {
34992 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
34993 }
34994 SCALED_PRESSURE3_DATA::ID => {
34995 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
34996 }
34997 SERIAL_CONTROL_DATA::ID => {
34998 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
34999 }
35000 SERVO_OUTPUT_RAW_DATA::ID => {
35001 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
35002 }
35003 SETUP_SIGNING_DATA::ID => {
35004 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
35005 }
35006 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
35007 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
35008 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
35009 }
35010 SET_ATTITUDE_TARGET_DATA::ID => {
35011 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
35012 }
35013 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
35014 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
35015 }
35016 SET_HOME_POSITION_DATA::ID => {
35017 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
35018 }
35019 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
35020 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
35021 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
35022 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
35023 }
35024 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
35025 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
35026 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
35027 }
35028 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
35029 SMART_BATTERY_INFO_DATA::ID => {
35030 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
35031 }
35032 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
35033 STORAGE_INFORMATION_DATA::ID => {
35034 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
35035 }
35036 SUPPORTED_TUNES_DATA::ID => {
35037 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
35038 }
35039 SYSTEM_TIME_DATA::ID => {
35040 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
35041 }
35042 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
35043 TERRAIN_CHECK_DATA::ID => {
35044 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
35045 }
35046 TERRAIN_DATA_DATA::ID => {
35047 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
35048 }
35049 TERRAIN_REPORT_DATA::ID => {
35050 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
35051 }
35052 TERRAIN_REQUEST_DATA::ID => {
35053 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
35054 }
35055 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
35056 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
35057 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
35058 .map(Self::TIME_ESTIMATE_TO_TARGET)
35059 }
35060 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35061 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
35062 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
35063 }
35064 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35065 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
35066 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
35067 }
35068 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
35069 UAVCAN_NODE_INFO_DATA::ID => {
35070 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
35071 }
35072 UAVCAN_NODE_STATUS_DATA::ID => {
35073 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
35074 }
35075 UTM_GLOBAL_POSITION_DATA::ID => {
35076 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
35077 }
35078 V2_EXTENSION_DATA::ID => {
35079 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
35080 }
35081 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
35082 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
35083 VICON_POSITION_ESTIMATE_DATA::ID => {
35084 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
35085 .map(Self::VICON_POSITION_ESTIMATE)
35086 }
35087 VIDEO_STREAM_INFORMATION_DATA::ID => {
35088 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
35089 .map(Self::VIDEO_STREAM_INFORMATION)
35090 }
35091 VIDEO_STREAM_STATUS_DATA::ID => {
35092 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
35093 }
35094 VISION_POSITION_ESTIMATE_DATA::ID => {
35095 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
35096 .map(Self::VISION_POSITION_ESTIMATE)
35097 }
35098 VISION_SPEED_ESTIMATE_DATA::ID => {
35099 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
35100 }
35101 WHEEL_DISTANCE_DATA::ID => {
35102 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
35103 }
35104 WIFI_CONFIG_AP_DATA::ID => {
35105 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
35106 }
35107 WINCH_STATUS_DATA::ID => {
35108 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
35109 }
35110 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
35111 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
35112 }
35113 }
35114 fn message_name(&self) -> &'static str {
35115 match self {
35116 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
35117 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
35118 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
35119 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
35120 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
35121 Self::ARRAY_TEST_0(..) => ARRAY_TEST_0_DATA::NAME,
35122 Self::ARRAY_TEST_1(..) => ARRAY_TEST_1_DATA::NAME,
35123 Self::ARRAY_TEST_3(..) => ARRAY_TEST_3_DATA::NAME,
35124 Self::ARRAY_TEST_4(..) => ARRAY_TEST_4_DATA::NAME,
35125 Self::ARRAY_TEST_5(..) => ARRAY_TEST_5_DATA::NAME,
35126 Self::ARRAY_TEST_6(..) => ARRAY_TEST_6_DATA::NAME,
35127 Self::ARRAY_TEST_7(..) => ARRAY_TEST_7_DATA::NAME,
35128 Self::ARRAY_TEST_8(..) => ARRAY_TEST_8_DATA::NAME,
35129 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
35130 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
35131 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
35132 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
35133 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
35134 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
35135 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
35136 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
35137 }
35138 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
35139 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
35140 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
35141 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
35142 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
35143 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
35144 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
35145 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
35146 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
35147 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
35148 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
35149 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
35150 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
35151 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
35152 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
35153 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
35154 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
35155 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
35156 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
35157 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
35158 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
35159 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
35160 Self::COLLISION(..) => COLLISION_DATA::NAME,
35161 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
35162 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
35163 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
35164 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
35165 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
35166 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
35167 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
35168 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
35169 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
35170 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
35171 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
35172 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
35173 Self::DEBUG(..) => DEBUG_DATA::NAME,
35174 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
35175 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
35176 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
35177 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
35178 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
35179 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
35180 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
35181 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
35182 Self::EVENT(..) => EVENT_DATA::NAME,
35183 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
35184 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
35185 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
35186 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
35187 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
35188 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
35189 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
35190 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
35191 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
35192 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
35193 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
35194 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
35195 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
35196 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
35197 }
35198 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
35199 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
35200 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
35201 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
35202 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
35203 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
35204 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
35205 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
35206 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
35207 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
35208 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
35209 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
35210 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
35211 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
35212 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
35213 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
35214 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
35215 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
35216 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
35217 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
35218 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
35219 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
35220 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
35221 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
35222 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
35223 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
35224 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
35225 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
35226 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
35227 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
35228 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
35229 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
35230 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
35231 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
35232 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
35233 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
35234 }
35235 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
35236 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
35237 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
35238 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
35239 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
35240 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
35241 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
35242 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
35243 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
35244 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
35245 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
35246 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
35247 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
35248 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
35249 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
35250 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
35251 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
35252 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
35253 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
35254 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
35255 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
35256 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
35257 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
35258 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
35259 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
35260 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
35261 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
35262 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
35263 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
35264 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
35265 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
35266 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
35267 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
35268 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
35269 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
35270 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
35271 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
35272 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
35273 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
35274 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
35275 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
35276 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
35277 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
35278 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
35279 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
35280 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
35281 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
35282 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
35283 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
35284 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
35285 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
35286 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
35287 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
35288 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
35289 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
35290 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
35291 Self::PING(..) => PING_DATA::NAME,
35292 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
35293 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
35294 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
35295 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
35296 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
35297 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
35298 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
35299 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
35300 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
35301 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
35302 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
35303 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
35304 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
35305 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
35306 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
35307 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
35308 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
35309 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
35310 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
35311 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
35312 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
35313 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
35314 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
35315 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
35316 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
35317 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
35318 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
35319 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
35320 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
35321 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
35322 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
35323 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
35324 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
35325 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
35326 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
35327 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
35328 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
35329 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
35330 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
35331 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
35332 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
35333 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
35334 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
35335 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
35336 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
35337 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
35338 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
35339 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
35340 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
35341 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
35342 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
35343 }
35344 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
35345 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
35346 }
35347 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
35348 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
35349 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
35350 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
35351 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
35352 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
35353 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
35354 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
35355 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
35356 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
35357 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
35358 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
35359 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
35360 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
35361 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
35362 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
35363 }
35364 }
35365 fn message_id(&self) -> u32 {
35366 match self {
35367 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
35368 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
35369 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
35370 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
35371 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
35372 Self::ARRAY_TEST_0(..) => ARRAY_TEST_0_DATA::ID,
35373 Self::ARRAY_TEST_1(..) => ARRAY_TEST_1_DATA::ID,
35374 Self::ARRAY_TEST_3(..) => ARRAY_TEST_3_DATA::ID,
35375 Self::ARRAY_TEST_4(..) => ARRAY_TEST_4_DATA::ID,
35376 Self::ARRAY_TEST_5(..) => ARRAY_TEST_5_DATA::ID,
35377 Self::ARRAY_TEST_6(..) => ARRAY_TEST_6_DATA::ID,
35378 Self::ARRAY_TEST_7(..) => ARRAY_TEST_7_DATA::ID,
35379 Self::ARRAY_TEST_8(..) => ARRAY_TEST_8_DATA::ID,
35380 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
35381 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
35382 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
35383 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
35384 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
35385 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
35386 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
35387 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
35388 }
35389 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
35390 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
35391 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
35392 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
35393 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
35394 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
35395 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
35396 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
35397 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
35398 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
35399 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
35400 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
35401 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
35402 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
35403 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
35404 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
35405 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
35406 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
35407 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
35408 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
35409 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
35410 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
35411 Self::COLLISION(..) => COLLISION_DATA::ID,
35412 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
35413 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
35414 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
35415 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
35416 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
35417 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
35418 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
35419 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
35420 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
35421 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
35422 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
35423 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
35424 Self::DEBUG(..) => DEBUG_DATA::ID,
35425 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
35426 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
35427 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
35428 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
35429 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
35430 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
35431 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
35432 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
35433 Self::EVENT(..) => EVENT_DATA::ID,
35434 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
35435 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
35436 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
35437 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
35438 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
35439 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
35440 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
35441 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
35442 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
35443 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
35444 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
35445 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
35446 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
35447 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
35448 }
35449 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
35450 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
35451 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
35452 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
35453 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
35454 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
35455 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
35456 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
35457 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
35458 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
35459 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
35460 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
35461 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
35462 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
35463 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
35464 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
35465 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
35466 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
35467 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
35468 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
35469 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
35470 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
35471 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
35472 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
35473 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
35474 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
35475 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
35476 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
35477 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
35478 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
35479 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
35480 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
35481 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
35482 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
35483 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
35484 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
35485 }
35486 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
35487 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
35488 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
35489 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
35490 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
35491 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
35492 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
35493 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
35494 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
35495 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
35496 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
35497 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
35498 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
35499 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
35500 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
35501 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
35502 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
35503 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
35504 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
35505 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
35506 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
35507 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
35508 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
35509 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
35510 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
35511 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
35512 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
35513 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
35514 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
35515 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
35516 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
35517 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
35518 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
35519 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
35520 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
35521 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
35522 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
35523 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
35524 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
35525 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
35526 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
35527 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
35528 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
35529 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
35530 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
35531 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
35532 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
35533 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
35534 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
35535 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
35536 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
35537 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
35538 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
35539 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
35540 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
35541 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
35542 Self::PING(..) => PING_DATA::ID,
35543 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
35544 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
35545 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
35546 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
35547 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
35548 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
35549 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
35550 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
35551 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
35552 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
35553 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
35554 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
35555 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
35556 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
35557 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
35558 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
35559 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
35560 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
35561 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
35562 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
35563 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
35564 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
35565 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
35566 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
35567 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
35568 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
35569 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
35570 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
35571 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
35572 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
35573 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
35574 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
35575 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
35576 Self::SET_MODE(..) => SET_MODE_DATA::ID,
35577 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
35578 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
35579 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
35580 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
35581 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
35582 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
35583 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
35584 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
35585 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
35586 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
35587 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
35588 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
35589 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
35590 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
35591 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
35592 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
35593 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
35594 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
35595 }
35596 Self::TUNNEL(..) => TUNNEL_DATA::ID,
35597 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
35598 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
35599 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
35600 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
35601 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
35602 Self::VIBRATION(..) => VIBRATION_DATA::ID,
35603 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
35604 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
35605 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
35606 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
35607 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
35608 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
35609 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
35610 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
35611 Self::WIND_COV(..) => WIND_COV_DATA::ID,
35612 }
35613 }
35614 fn message_id_from_name(name: &str) -> Option<u32> {
35615 match name {
35616 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
35617 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
35618 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
35619 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
35620 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
35621 ARRAY_TEST_0_DATA::NAME => Some(ARRAY_TEST_0_DATA::ID),
35622 ARRAY_TEST_1_DATA::NAME => Some(ARRAY_TEST_1_DATA::ID),
35623 ARRAY_TEST_3_DATA::NAME => Some(ARRAY_TEST_3_DATA::ID),
35624 ARRAY_TEST_4_DATA::NAME => Some(ARRAY_TEST_4_DATA::ID),
35625 ARRAY_TEST_5_DATA::NAME => Some(ARRAY_TEST_5_DATA::ID),
35626 ARRAY_TEST_6_DATA::NAME => Some(ARRAY_TEST_6_DATA::ID),
35627 ARRAY_TEST_7_DATA::NAME => Some(ARRAY_TEST_7_DATA::ID),
35628 ARRAY_TEST_8_DATA::NAME => Some(ARRAY_TEST_8_DATA::ID),
35629 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
35630 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
35631 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
35632 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
35633 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
35634 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
35635 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
35636 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
35637 }
35638 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
35639 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
35640 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
35641 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
35642 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
35643 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
35644 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
35645 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
35646 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
35647 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
35648 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
35649 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
35650 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
35651 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
35652 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
35653 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
35654 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
35655 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
35656 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
35657 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
35658 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
35659 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
35660 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
35661 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
35662 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
35663 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
35664 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
35665 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
35666 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
35667 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
35668 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
35669 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
35670 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
35671 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
35672 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
35673 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
35674 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
35675 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
35676 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
35677 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
35678 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
35679 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
35680 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
35681 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
35682 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
35683 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
35684 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
35685 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
35686 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
35687 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
35688 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
35689 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
35690 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
35691 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
35692 }
35693 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
35694 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
35695 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
35696 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
35697 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
35698 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
35699 }
35700 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
35701 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
35702 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
35703 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
35704 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
35705 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
35706 }
35707 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
35708 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
35709 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
35710 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
35711 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
35712 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
35713 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
35714 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
35715 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
35716 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
35717 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
35718 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
35719 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
35720 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
35721 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
35722 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
35723 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
35724 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
35725 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
35726 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
35727 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
35728 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
35729 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
35730 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
35731 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
35732 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
35733 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
35734 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
35735 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
35736 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
35737 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
35738 }
35739 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
35740 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
35741 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
35742 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
35743 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
35744 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
35745 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
35746 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
35747 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
35748 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
35749 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
35750 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
35751 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
35752 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
35753 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
35754 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
35755 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
35756 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
35757 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
35758 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
35759 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
35760 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
35761 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
35762 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
35763 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
35764 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
35765 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
35766 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
35767 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
35768 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
35769 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
35770 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
35771 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
35772 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
35773 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
35774 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
35775 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
35776 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
35777 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
35778 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
35779 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
35780 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
35781 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
35782 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
35783 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
35784 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
35785 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
35786 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
35787 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
35788 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
35789 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
35790 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
35791 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
35792 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
35793 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
35794 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
35795 PING_DATA::NAME => Some(PING_DATA::ID),
35796 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
35797 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
35798 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
35799 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
35800 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
35801 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
35802 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
35803 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
35804 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
35805 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
35806 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
35807 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
35808 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
35809 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
35810 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
35811 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
35812 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
35813 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
35814 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
35815 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
35816 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
35817 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
35818 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
35819 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
35820 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
35821 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
35822 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
35823 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
35824 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
35825 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
35826 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
35827 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
35828 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
35829 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
35830 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
35831 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
35832 }
35833 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
35834 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
35835 }
35836 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
35837 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
35838 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
35839 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
35840 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
35841 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
35842 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
35843 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
35844 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
35845 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
35846 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
35847 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
35848 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
35849 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
35850 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
35851 }
35852 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
35853 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
35854 }
35855 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
35856 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
35857 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
35858 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
35859 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
35860 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
35861 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
35862 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
35863 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
35864 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
35865 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
35866 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
35867 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
35868 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
35869 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
35870 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
35871 _ => None,
35872 }
35873 }
35874 fn default_message_from_id(id: u32) -> Option<Self> {
35875 match id {
35876 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
35877 ACTUATOR_CONTROL_TARGET_DATA::default(),
35878 )),
35879 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
35880 ACTUATOR_OUTPUT_STATUS_DATA::default(),
35881 )),
35882 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
35883 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
35884 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
35885 ARRAY_TEST_0_DATA::ID => Some(Self::ARRAY_TEST_0(ARRAY_TEST_0_DATA::default())),
35886 ARRAY_TEST_1_DATA::ID => Some(Self::ARRAY_TEST_1(ARRAY_TEST_1_DATA::default())),
35887 ARRAY_TEST_3_DATA::ID => Some(Self::ARRAY_TEST_3(ARRAY_TEST_3_DATA::default())),
35888 ARRAY_TEST_4_DATA::ID => Some(Self::ARRAY_TEST_4(ARRAY_TEST_4_DATA::default())),
35889 ARRAY_TEST_5_DATA::ID => Some(Self::ARRAY_TEST_5(ARRAY_TEST_5_DATA::default())),
35890 ARRAY_TEST_6_DATA::ID => Some(Self::ARRAY_TEST_6(ARRAY_TEST_6_DATA::default())),
35891 ARRAY_TEST_7_DATA::ID => Some(Self::ARRAY_TEST_7(ARRAY_TEST_7_DATA::default())),
35892 ARRAY_TEST_8_DATA::ID => Some(Self::ARRAY_TEST_8(ARRAY_TEST_8_DATA::default())),
35893 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
35894 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
35895 ATTITUDE_QUATERNION_DATA::default(),
35896 )),
35897 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
35898 ATTITUDE_QUATERNION_COV_DATA::default(),
35899 )),
35900 ATTITUDE_TARGET_DATA::ID => {
35901 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
35902 }
35903 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
35904 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
35905 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35906 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
35907 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
35908 ))
35909 }
35910 AUTOPILOT_VERSION_DATA::ID => {
35911 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
35912 }
35913 AVAILABLE_MODES_DATA::ID => {
35914 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
35915 }
35916 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
35917 AVAILABLE_MODES_MONITOR_DATA::default(),
35918 )),
35919 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
35920 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
35921 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
35922 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
35923 CAMERA_CAPTURE_STATUS_DATA::default(),
35924 )),
35925 CAMERA_FOV_STATUS_DATA::ID => {
35926 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
35927 }
35928 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
35929 CAMERA_IMAGE_CAPTURED_DATA::default(),
35930 )),
35931 CAMERA_INFORMATION_DATA::ID => {
35932 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
35933 }
35934 CAMERA_SETTINGS_DATA::ID => {
35935 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
35936 }
35937 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
35938 CAMERA_THERMAL_RANGE_DATA::default(),
35939 )),
35940 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
35941 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
35942 )),
35943 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
35944 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
35945 )),
35946 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
35947 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
35948 CAN_FILTER_MODIFY_DATA::ID => {
35949 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
35950 }
35951 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
35952 CELLULAR_CONFIG_DATA::ID => {
35953 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
35954 }
35955 CELLULAR_STATUS_DATA::ID => {
35956 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
35957 }
35958 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
35959 CHANGE_OPERATOR_CONTROL_DATA::default(),
35960 )),
35961 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
35962 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
35963 )),
35964 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
35965 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
35966 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
35967 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
35968 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
35969 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
35970 COMPONENT_INFORMATION_DATA::default(),
35971 )),
35972 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
35973 COMPONENT_INFORMATION_BASIC_DATA::default(),
35974 )),
35975 COMPONENT_METADATA_DATA::ID => {
35976 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
35977 }
35978 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
35979 CONTROL_SYSTEM_STATE_DATA::default(),
35980 )),
35981 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
35982 CURRENT_EVENT_SEQUENCE_DATA::default(),
35983 )),
35984 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
35985 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
35986 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
35987 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
35988 )),
35989 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
35990 DEBUG_FLOAT_ARRAY_DATA::ID => {
35991 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
35992 }
35993 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
35994 DISTANCE_SENSOR_DATA::ID => {
35995 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
35996 }
35997 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
35998 ENCAPSULATED_DATA_DATA::ID => {
35999 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
36000 }
36001 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
36002 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
36003 ESTIMATOR_STATUS_DATA::ID => {
36004 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
36005 }
36006 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
36007 EXTENDED_SYS_STATE_DATA::ID => {
36008 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
36009 }
36010 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
36011 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
36012 FILE_TRANSFER_PROTOCOL_DATA::default(),
36013 )),
36014 FLIGHT_INFORMATION_DATA::ID => {
36015 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
36016 }
36017 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
36018 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
36019 GENERATOR_STATUS_DATA::ID => {
36020 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
36021 }
36022 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
36023 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
36024 )),
36025 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
36026 GIMBAL_DEVICE_INFORMATION_DATA::default(),
36027 )),
36028 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
36029 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
36030 )),
36031 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
36032 GIMBAL_MANAGER_INFORMATION_DATA::default(),
36033 )),
36034 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
36035 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
36036 )),
36037 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
36038 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
36039 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
36040 ))
36041 }
36042 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
36043 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
36044 )),
36045 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
36046 GIMBAL_MANAGER_STATUS_DATA::default(),
36047 )),
36048 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
36049 GLOBAL_POSITION_INT_DATA::default(),
36050 )),
36051 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
36052 GLOBAL_POSITION_INT_COV_DATA::default(),
36053 )),
36054 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
36055 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
36056 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
36057 ))
36058 }
36059 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
36060 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
36061 GPS_GLOBAL_ORIGIN_DATA::ID => {
36062 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
36063 }
36064 GPS_INJECT_DATA_DATA::ID => {
36065 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
36066 }
36067 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
36068 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
36069 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
36070 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
36071 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
36072 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
36073 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
36074 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
36075 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
36076 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
36077 HIL_ACTUATOR_CONTROLS_DATA::default(),
36078 )),
36079 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
36080 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
36081 HIL_OPTICAL_FLOW_DATA::ID => {
36082 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
36083 }
36084 HIL_RC_INPUTS_RAW_DATA::ID => {
36085 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
36086 }
36087 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
36088 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
36089 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
36090 HIL_STATE_QUATERNION_DATA::default(),
36091 )),
36092 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
36093 HYGROMETER_SENSOR_DATA::ID => {
36094 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
36095 }
36096 ILLUMINATOR_STATUS_DATA::ID => {
36097 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
36098 }
36099 ISBD_LINK_STATUS_DATA::ID => {
36100 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
36101 }
36102 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
36103 LINK_NODE_STATUS_DATA::ID => {
36104 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
36105 }
36106 LOCAL_POSITION_NED_DATA::ID => {
36107 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
36108 }
36109 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
36110 LOCAL_POSITION_NED_COV_DATA::default(),
36111 )),
36112 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
36113 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
36114 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
36115 ))
36116 }
36117 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
36118 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
36119 LOGGING_DATA_ACKED_DATA::ID => {
36120 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
36121 }
36122 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
36123 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
36124 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
36125 LOG_REQUEST_DATA_DATA::ID => {
36126 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
36127 }
36128 LOG_REQUEST_END_DATA::ID => {
36129 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
36130 }
36131 LOG_REQUEST_LIST_DATA::ID => {
36132 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
36133 }
36134 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
36135 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
36136 MANUAL_SETPOINT_DATA::ID => {
36137 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
36138 }
36139 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
36140 MESSAGE_INTERVAL_DATA::ID => {
36141 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
36142 }
36143 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
36144 MISSION_CLEAR_ALL_DATA::ID => {
36145 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
36146 }
36147 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
36148 MISSION_CURRENT_DATA::ID => {
36149 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
36150 }
36151 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
36152 MISSION_ITEM_INT_DATA::ID => {
36153 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
36154 }
36155 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
36156 MISSION_ITEM_REACHED_DATA::default(),
36157 )),
36158 MISSION_REQUEST_DATA::ID => {
36159 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
36160 }
36161 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
36162 MISSION_REQUEST_INT_DATA::default(),
36163 )),
36164 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
36165 MISSION_REQUEST_LIST_DATA::default(),
36166 )),
36167 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
36168 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
36169 )),
36170 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
36171 MISSION_SET_CURRENT_DATA::default(),
36172 )),
36173 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
36174 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
36175 )),
36176 MOUNT_ORIENTATION_DATA::ID => {
36177 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
36178 }
36179 NAMED_VALUE_FLOAT_DATA::ID => {
36180 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
36181 }
36182 NAMED_VALUE_INT_DATA::ID => {
36183 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
36184 }
36185 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
36186 NAV_CONTROLLER_OUTPUT_DATA::default(),
36187 )),
36188 OBSTACLE_DISTANCE_DATA::ID => {
36189 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
36190 }
36191 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
36192 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
36193 ONBOARD_COMPUTER_STATUS_DATA::default(),
36194 )),
36195 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
36196 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
36197 )),
36198 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
36199 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
36200 )),
36201 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
36202 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
36203 )),
36204 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
36205 OPEN_DRONE_ID_LOCATION_DATA::default(),
36206 )),
36207 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
36208 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
36209 )),
36210 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
36211 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
36212 )),
36213 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
36214 OPEN_DRONE_ID_SELF_ID_DATA::default(),
36215 )),
36216 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
36217 OPEN_DRONE_ID_SYSTEM_DATA::default(),
36218 )),
36219 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
36220 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
36221 )),
36222 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
36223 OPTICAL_FLOW_RAD_DATA::ID => {
36224 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
36225 }
36226 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
36227 ORBIT_EXECUTION_STATUS_DATA::default(),
36228 )),
36229 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
36230 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
36231 PARAM_EXT_REQUEST_LIST_DATA::default(),
36232 )),
36233 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
36234 PARAM_EXT_REQUEST_READ_DATA::default(),
36235 )),
36236 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
36237 PARAM_EXT_VALUE_DATA::ID => {
36238 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
36239 }
36240 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
36241 PARAM_REQUEST_LIST_DATA::ID => {
36242 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
36243 }
36244 PARAM_REQUEST_READ_DATA::ID => {
36245 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
36246 }
36247 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
36248 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
36249 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
36250 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
36251 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
36252 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
36253 POSITION_TARGET_GLOBAL_INT_DATA::default(),
36254 )),
36255 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
36256 POSITION_TARGET_LOCAL_NED_DATA::default(),
36257 )),
36258 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
36259 PROTOCOL_VERSION_DATA::ID => {
36260 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
36261 }
36262 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
36263 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
36264 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
36265 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
36266 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
36267 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
36268 RC_CHANNELS_OVERRIDE_DATA::default(),
36269 )),
36270 RC_CHANNELS_RAW_DATA::ID => {
36271 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
36272 }
36273 RC_CHANNELS_SCALED_DATA::ID => {
36274 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
36275 }
36276 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
36277 REQUEST_DATA_STREAM_DATA::default(),
36278 )),
36279 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
36280 RESOURCE_REQUEST_DATA::ID => {
36281 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
36282 }
36283 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
36284 RESPONSE_EVENT_ERROR_DATA::default(),
36285 )),
36286 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
36287 SAFETY_ALLOWED_AREA_DATA::default(),
36288 )),
36289 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
36290 SAFETY_SET_ALLOWED_AREA_DATA::default(),
36291 )),
36292 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
36293 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
36294 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
36295 SCALED_PRESSURE_DATA::ID => {
36296 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
36297 }
36298 SCALED_PRESSURE2_DATA::ID => {
36299 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
36300 }
36301 SCALED_PRESSURE3_DATA::ID => {
36302 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
36303 }
36304 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
36305 SERVO_OUTPUT_RAW_DATA::ID => {
36306 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
36307 }
36308 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
36309 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
36310 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
36311 )),
36312 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
36313 SET_ATTITUDE_TARGET_DATA::default(),
36314 )),
36315 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
36316 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
36317 )),
36318 SET_HOME_POSITION_DATA::ID => {
36319 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
36320 }
36321 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
36322 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
36323 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
36324 )),
36325 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
36326 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
36327 )),
36328 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
36329 SMART_BATTERY_INFO_DATA::ID => {
36330 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
36331 }
36332 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
36333 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
36334 STORAGE_INFORMATION_DATA::default(),
36335 )),
36336 SUPPORTED_TUNES_DATA::ID => {
36337 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
36338 }
36339 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
36340 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
36341 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
36342 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
36343 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
36344 TERRAIN_REQUEST_DATA::ID => {
36345 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
36346 }
36347 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
36348 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
36349 TIME_ESTIMATE_TO_TARGET_DATA::default(),
36350 )),
36351 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
36352 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
36353 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
36354 ))
36355 }
36356 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
36357 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
36358 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
36359 ))
36360 }
36361 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
36362 UAVCAN_NODE_INFO_DATA::ID => {
36363 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
36364 }
36365 UAVCAN_NODE_STATUS_DATA::ID => {
36366 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
36367 }
36368 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
36369 UTM_GLOBAL_POSITION_DATA::default(),
36370 )),
36371 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
36372 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
36373 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
36374 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
36375 VICON_POSITION_ESTIMATE_DATA::default(),
36376 )),
36377 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
36378 VIDEO_STREAM_INFORMATION_DATA::default(),
36379 )),
36380 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
36381 VIDEO_STREAM_STATUS_DATA::default(),
36382 )),
36383 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
36384 VISION_POSITION_ESTIMATE_DATA::default(),
36385 )),
36386 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
36387 VISION_SPEED_ESTIMATE_DATA::default(),
36388 )),
36389 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
36390 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
36391 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
36392 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
36393 _ => None,
36394 }
36395 }
36396 #[cfg(feature = "arbitrary")]
36397 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
36398 match id {
36399 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
36400 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
36401 )),
36402 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
36403 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
36404 )),
36405 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
36406 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
36407 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
36408 ARRAY_TEST_0_DATA::ID => Some(Self::ARRAY_TEST_0(ARRAY_TEST_0_DATA::random(rng))),
36409 ARRAY_TEST_1_DATA::ID => Some(Self::ARRAY_TEST_1(ARRAY_TEST_1_DATA::random(rng))),
36410 ARRAY_TEST_3_DATA::ID => Some(Self::ARRAY_TEST_3(ARRAY_TEST_3_DATA::random(rng))),
36411 ARRAY_TEST_4_DATA::ID => Some(Self::ARRAY_TEST_4(ARRAY_TEST_4_DATA::random(rng))),
36412 ARRAY_TEST_5_DATA::ID => Some(Self::ARRAY_TEST_5(ARRAY_TEST_5_DATA::random(rng))),
36413 ARRAY_TEST_6_DATA::ID => Some(Self::ARRAY_TEST_6(ARRAY_TEST_6_DATA::random(rng))),
36414 ARRAY_TEST_7_DATA::ID => Some(Self::ARRAY_TEST_7(ARRAY_TEST_7_DATA::random(rng))),
36415 ARRAY_TEST_8_DATA::ID => Some(Self::ARRAY_TEST_8(ARRAY_TEST_8_DATA::random(rng))),
36416 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
36417 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
36418 ATTITUDE_QUATERNION_DATA::random(rng),
36419 )),
36420 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
36421 ATTITUDE_QUATERNION_COV_DATA::random(rng),
36422 )),
36423 ATTITUDE_TARGET_DATA::ID => {
36424 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
36425 }
36426 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
36427 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
36428 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
36429 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
36430 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
36431 ))
36432 }
36433 AUTOPILOT_VERSION_DATA::ID => {
36434 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
36435 }
36436 AVAILABLE_MODES_DATA::ID => {
36437 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
36438 }
36439 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
36440 AVAILABLE_MODES_MONITOR_DATA::random(rng),
36441 )),
36442 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
36443 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
36444 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
36445 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
36446 CAMERA_CAPTURE_STATUS_DATA::random(rng),
36447 )),
36448 CAMERA_FOV_STATUS_DATA::ID => {
36449 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
36450 }
36451 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
36452 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
36453 )),
36454 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
36455 CAMERA_INFORMATION_DATA::random(rng),
36456 )),
36457 CAMERA_SETTINGS_DATA::ID => {
36458 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
36459 }
36460 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
36461 CAMERA_THERMAL_RANGE_DATA::random(rng),
36462 )),
36463 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
36464 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
36465 )),
36466 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
36467 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
36468 )),
36469 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
36470 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
36471 CAN_FILTER_MODIFY_DATA::ID => {
36472 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
36473 }
36474 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
36475 CELLULAR_CONFIG_DATA::ID => {
36476 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
36477 }
36478 CELLULAR_STATUS_DATA::ID => {
36479 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
36480 }
36481 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
36482 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
36483 )),
36484 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
36485 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
36486 )),
36487 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
36488 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
36489 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
36490 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
36491 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
36492 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
36493 COMPONENT_INFORMATION_DATA::random(rng),
36494 )),
36495 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
36496 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
36497 )),
36498 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
36499 COMPONENT_METADATA_DATA::random(rng),
36500 )),
36501 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
36502 CONTROL_SYSTEM_STATE_DATA::random(rng),
36503 )),
36504 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
36505 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
36506 )),
36507 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
36508 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
36509 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
36510 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
36511 )),
36512 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
36513 DEBUG_FLOAT_ARRAY_DATA::ID => {
36514 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
36515 }
36516 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
36517 DISTANCE_SENSOR_DATA::ID => {
36518 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
36519 }
36520 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
36521 ENCAPSULATED_DATA_DATA::ID => {
36522 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
36523 }
36524 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
36525 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
36526 ESTIMATOR_STATUS_DATA::ID => {
36527 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
36528 }
36529 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
36530 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
36531 EXTENDED_SYS_STATE_DATA::random(rng),
36532 )),
36533 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
36534 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
36535 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
36536 )),
36537 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
36538 FLIGHT_INFORMATION_DATA::random(rng),
36539 )),
36540 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
36541 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
36542 GENERATOR_STATUS_DATA::ID => {
36543 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
36544 }
36545 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
36546 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
36547 )),
36548 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
36549 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
36550 )),
36551 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
36552 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
36553 )),
36554 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
36555 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
36556 )),
36557 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
36558 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
36559 )),
36560 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
36561 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
36562 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
36563 ))
36564 }
36565 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
36566 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
36567 )),
36568 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
36569 GIMBAL_MANAGER_STATUS_DATA::random(rng),
36570 )),
36571 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
36572 GLOBAL_POSITION_INT_DATA::random(rng),
36573 )),
36574 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
36575 GLOBAL_POSITION_INT_COV_DATA::random(rng),
36576 )),
36577 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
36578 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
36579 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
36580 ))
36581 }
36582 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
36583 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
36584 GPS_GLOBAL_ORIGIN_DATA::ID => {
36585 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
36586 }
36587 GPS_INJECT_DATA_DATA::ID => {
36588 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
36589 }
36590 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
36591 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
36592 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
36593 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
36594 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
36595 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
36596 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
36597 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
36598 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
36599 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
36600 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
36601 )),
36602 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
36603 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
36604 HIL_OPTICAL_FLOW_DATA::ID => {
36605 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
36606 }
36607 HIL_RC_INPUTS_RAW_DATA::ID => {
36608 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
36609 }
36610 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
36611 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
36612 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
36613 HIL_STATE_QUATERNION_DATA::random(rng),
36614 )),
36615 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
36616 HYGROMETER_SENSOR_DATA::ID => {
36617 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
36618 }
36619 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
36620 ILLUMINATOR_STATUS_DATA::random(rng),
36621 )),
36622 ISBD_LINK_STATUS_DATA::ID => {
36623 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
36624 }
36625 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
36626 LINK_NODE_STATUS_DATA::ID => {
36627 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
36628 }
36629 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
36630 LOCAL_POSITION_NED_DATA::random(rng),
36631 )),
36632 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
36633 LOCAL_POSITION_NED_COV_DATA::random(rng),
36634 )),
36635 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
36636 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
36637 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
36638 ))
36639 }
36640 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
36641 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
36642 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
36643 LOGGING_DATA_ACKED_DATA::random(rng),
36644 )),
36645 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
36646 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
36647 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
36648 LOG_REQUEST_DATA_DATA::ID => {
36649 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
36650 }
36651 LOG_REQUEST_END_DATA::ID => {
36652 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
36653 }
36654 LOG_REQUEST_LIST_DATA::ID => {
36655 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
36656 }
36657 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
36658 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
36659 MANUAL_SETPOINT_DATA::ID => {
36660 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
36661 }
36662 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
36663 MESSAGE_INTERVAL_DATA::ID => {
36664 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
36665 }
36666 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
36667 MISSION_CLEAR_ALL_DATA::ID => {
36668 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
36669 }
36670 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
36671 MISSION_CURRENT_DATA::ID => {
36672 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
36673 }
36674 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
36675 MISSION_ITEM_INT_DATA::ID => {
36676 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
36677 }
36678 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
36679 MISSION_ITEM_REACHED_DATA::random(rng),
36680 )),
36681 MISSION_REQUEST_DATA::ID => {
36682 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
36683 }
36684 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
36685 MISSION_REQUEST_INT_DATA::random(rng),
36686 )),
36687 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
36688 MISSION_REQUEST_LIST_DATA::random(rng),
36689 )),
36690 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
36691 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
36692 )),
36693 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
36694 MISSION_SET_CURRENT_DATA::random(rng),
36695 )),
36696 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
36697 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
36698 )),
36699 MOUNT_ORIENTATION_DATA::ID => {
36700 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
36701 }
36702 NAMED_VALUE_FLOAT_DATA::ID => {
36703 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
36704 }
36705 NAMED_VALUE_INT_DATA::ID => {
36706 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
36707 }
36708 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
36709 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
36710 )),
36711 OBSTACLE_DISTANCE_DATA::ID => {
36712 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
36713 }
36714 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
36715 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
36716 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
36717 )),
36718 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
36719 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
36720 )),
36721 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
36722 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
36723 )),
36724 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
36725 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
36726 )),
36727 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
36728 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
36729 )),
36730 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
36731 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
36732 )),
36733 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
36734 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
36735 )),
36736 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
36737 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
36738 )),
36739 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
36740 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
36741 )),
36742 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
36743 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
36744 )),
36745 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
36746 OPTICAL_FLOW_RAD_DATA::ID => {
36747 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
36748 }
36749 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
36750 ORBIT_EXECUTION_STATUS_DATA::random(rng),
36751 )),
36752 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
36753 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
36754 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
36755 )),
36756 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
36757 PARAM_EXT_REQUEST_READ_DATA::random(rng),
36758 )),
36759 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
36760 PARAM_EXT_VALUE_DATA::ID => {
36761 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
36762 }
36763 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
36764 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
36765 PARAM_REQUEST_LIST_DATA::random(rng),
36766 )),
36767 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
36768 PARAM_REQUEST_READ_DATA::random(rng),
36769 )),
36770 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
36771 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
36772 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
36773 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
36774 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
36775 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
36776 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
36777 )),
36778 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
36779 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
36780 )),
36781 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
36782 PROTOCOL_VERSION_DATA::ID => {
36783 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
36784 }
36785 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
36786 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
36787 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
36788 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
36789 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
36790 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
36791 RC_CHANNELS_OVERRIDE_DATA::random(rng),
36792 )),
36793 RC_CHANNELS_RAW_DATA::ID => {
36794 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
36795 }
36796 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
36797 RC_CHANNELS_SCALED_DATA::random(rng),
36798 )),
36799 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
36800 REQUEST_DATA_STREAM_DATA::random(rng),
36801 )),
36802 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
36803 RESOURCE_REQUEST_DATA::ID => {
36804 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
36805 }
36806 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
36807 RESPONSE_EVENT_ERROR_DATA::random(rng),
36808 )),
36809 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
36810 SAFETY_ALLOWED_AREA_DATA::random(rng),
36811 )),
36812 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
36813 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
36814 )),
36815 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
36816 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
36817 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
36818 SCALED_PRESSURE_DATA::ID => {
36819 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
36820 }
36821 SCALED_PRESSURE2_DATA::ID => {
36822 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
36823 }
36824 SCALED_PRESSURE3_DATA::ID => {
36825 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
36826 }
36827 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
36828 SERVO_OUTPUT_RAW_DATA::ID => {
36829 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
36830 }
36831 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
36832 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
36833 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
36834 )),
36835 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
36836 SET_ATTITUDE_TARGET_DATA::random(rng),
36837 )),
36838 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
36839 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
36840 )),
36841 SET_HOME_POSITION_DATA::ID => {
36842 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
36843 }
36844 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
36845 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
36846 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
36847 )),
36848 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
36849 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
36850 )),
36851 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
36852 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
36853 SMART_BATTERY_INFO_DATA::random(rng),
36854 )),
36855 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
36856 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
36857 STORAGE_INFORMATION_DATA::random(rng),
36858 )),
36859 SUPPORTED_TUNES_DATA::ID => {
36860 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
36861 }
36862 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
36863 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
36864 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
36865 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
36866 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
36867 TERRAIN_REQUEST_DATA::ID => {
36868 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
36869 }
36870 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
36871 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
36872 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
36873 )),
36874 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
36875 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
36876 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
36877 ))
36878 }
36879 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
36880 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
36881 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
36882 ))
36883 }
36884 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
36885 UAVCAN_NODE_INFO_DATA::ID => {
36886 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
36887 }
36888 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
36889 UAVCAN_NODE_STATUS_DATA::random(rng),
36890 )),
36891 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
36892 UTM_GLOBAL_POSITION_DATA::random(rng),
36893 )),
36894 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
36895 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
36896 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
36897 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
36898 VICON_POSITION_ESTIMATE_DATA::random(rng),
36899 )),
36900 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
36901 VIDEO_STREAM_INFORMATION_DATA::random(rng),
36902 )),
36903 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
36904 VIDEO_STREAM_STATUS_DATA::random(rng),
36905 )),
36906 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
36907 VISION_POSITION_ESTIMATE_DATA::random(rng),
36908 )),
36909 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
36910 VISION_SPEED_ESTIMATE_DATA::random(rng),
36911 )),
36912 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
36913 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
36914 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
36915 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
36916 _ => None,
36917 }
36918 }
36919 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
36920 match self {
36921 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
36922 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
36923 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
36924 Self::AIS_VESSEL(body) => body.ser(version, bytes),
36925 Self::ALTITUDE(body) => body.ser(version, bytes),
36926 Self::ARRAY_TEST_0(body) => body.ser(version, bytes),
36927 Self::ARRAY_TEST_1(body) => body.ser(version, bytes),
36928 Self::ARRAY_TEST_3(body) => body.ser(version, bytes),
36929 Self::ARRAY_TEST_4(body) => body.ser(version, bytes),
36930 Self::ARRAY_TEST_5(body) => body.ser(version, bytes),
36931 Self::ARRAY_TEST_6(body) => body.ser(version, bytes),
36932 Self::ARRAY_TEST_7(body) => body.ser(version, bytes),
36933 Self::ARRAY_TEST_8(body) => body.ser(version, bytes),
36934 Self::ATTITUDE(body) => body.ser(version, bytes),
36935 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
36936 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
36937 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
36938 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
36939 Self::AUTH_KEY(body) => body.ser(version, bytes),
36940 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
36941 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
36942 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
36943 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
36944 Self::BATTERY_INFO(body) => body.ser(version, bytes),
36945 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
36946 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
36947 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
36948 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
36949 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
36950 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
36951 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
36952 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
36953 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
36954 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
36955 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
36956 Self::CANFD_FRAME(body) => body.ser(version, bytes),
36957 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
36958 Self::CAN_FRAME(body) => body.ser(version, bytes),
36959 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
36960 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
36961 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
36962 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
36963 Self::COLLISION(body) => body.ser(version, bytes),
36964 Self::COMMAND_ACK(body) => body.ser(version, bytes),
36965 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
36966 Self::COMMAND_INT(body) => body.ser(version, bytes),
36967 Self::COMMAND_LONG(body) => body.ser(version, bytes),
36968 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
36969 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
36970 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
36971 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
36972 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
36973 Self::CURRENT_MODE(body) => body.ser(version, bytes),
36974 Self::DATA_STREAM(body) => body.ser(version, bytes),
36975 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
36976 Self::DEBUG(body) => body.ser(version, bytes),
36977 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
36978 Self::DEBUG_VECT(body) => body.ser(version, bytes),
36979 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
36980 Self::EFI_STATUS(body) => body.ser(version, bytes),
36981 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
36982 Self::ESC_INFO(body) => body.ser(version, bytes),
36983 Self::ESC_STATUS(body) => body.ser(version, bytes),
36984 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
36985 Self::EVENT(body) => body.ser(version, bytes),
36986 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
36987 Self::FENCE_STATUS(body) => body.ser(version, bytes),
36988 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
36989 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
36990 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
36991 Self::FUEL_STATUS(body) => body.ser(version, bytes),
36992 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
36993 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
36994 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
36995 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
36996 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
36997 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
36998 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
36999 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
37000 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
37001 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
37002 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
37003 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
37004 Self::GPS2_RAW(body) => body.ser(version, bytes),
37005 Self::GPS2_RTK(body) => body.ser(version, bytes),
37006 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
37007 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
37008 Self::GPS_INPUT(body) => body.ser(version, bytes),
37009 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
37010 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
37011 Self::GPS_RTK(body) => body.ser(version, bytes),
37012 Self::GPS_STATUS(body) => body.ser(version, bytes),
37013 Self::HEARTBEAT(body) => body.ser(version, bytes),
37014 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
37015 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
37016 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
37017 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
37018 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
37019 Self::HIL_GPS(body) => body.ser(version, bytes),
37020 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
37021 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
37022 Self::HIL_SENSOR(body) => body.ser(version, bytes),
37023 Self::HIL_STATE(body) => body.ser(version, bytes),
37024 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
37025 Self::HOME_POSITION(body) => body.ser(version, bytes),
37026 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
37027 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
37028 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
37029 Self::LANDING_TARGET(body) => body.ser(version, bytes),
37030 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
37031 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
37032 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
37033 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
37034 Self::LOGGING_ACK(body) => body.ser(version, bytes),
37035 Self::LOGGING_DATA(body) => body.ser(version, bytes),
37036 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
37037 Self::LOG_DATA(body) => body.ser(version, bytes),
37038 Self::LOG_ENTRY(body) => body.ser(version, bytes),
37039 Self::LOG_ERASE(body) => body.ser(version, bytes),
37040 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
37041 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
37042 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
37043 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
37044 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
37045 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
37046 Self::MEMORY_VECT(body) => body.ser(version, bytes),
37047 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
37048 Self::MISSION_ACK(body) => body.ser(version, bytes),
37049 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
37050 Self::MISSION_COUNT(body) => body.ser(version, bytes),
37051 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
37052 Self::MISSION_ITEM(body) => body.ser(version, bytes),
37053 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
37054 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
37055 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
37056 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
37057 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
37058 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
37059 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
37060 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
37061 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
37062 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
37063 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
37064 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
37065 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
37066 Self::ODOMETRY(body) => body.ser(version, bytes),
37067 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
37068 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
37069 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
37070 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
37071 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
37072 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
37073 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
37074 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
37075 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
37076 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
37077 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
37078 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
37079 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
37080 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
37081 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
37082 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
37083 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
37084 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
37085 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
37086 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
37087 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
37088 Self::PARAM_SET(body) => body.ser(version, bytes),
37089 Self::PARAM_VALUE(body) => body.ser(version, bytes),
37090 Self::PING(body) => body.ser(version, bytes),
37091 Self::PLAY_TUNE(body) => body.ser(version, bytes),
37092 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
37093 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
37094 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
37095 Self::POWER_STATUS(body) => body.ser(version, bytes),
37096 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
37097 Self::RADIO_STATUS(body) => body.ser(version, bytes),
37098 Self::RAW_IMU(body) => body.ser(version, bytes),
37099 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
37100 Self::RAW_RPM(body) => body.ser(version, bytes),
37101 Self::RC_CHANNELS(body) => body.ser(version, bytes),
37102 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
37103 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
37104 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
37105 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
37106 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
37107 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
37108 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
37109 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
37110 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
37111 Self::SCALED_IMU(body) => body.ser(version, bytes),
37112 Self::SCALED_IMU2(body) => body.ser(version, bytes),
37113 Self::SCALED_IMU3(body) => body.ser(version, bytes),
37114 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
37115 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
37116 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
37117 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
37118 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
37119 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
37120 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
37121 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
37122 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
37123 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
37124 Self::SET_MODE(body) => body.ser(version, bytes),
37125 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
37126 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
37127 Self::SIM_STATE(body) => body.ser(version, bytes),
37128 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
37129 Self::STATUSTEXT(body) => body.ser(version, bytes),
37130 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
37131 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
37132 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
37133 Self::SYS_STATUS(body) => body.ser(version, bytes),
37134 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
37135 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
37136 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
37137 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
37138 Self::TIMESYNC(body) => body.ser(version, bytes),
37139 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
37140 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
37141 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
37142 Self::TUNNEL(body) => body.ser(version, bytes),
37143 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
37144 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
37145 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
37146 Self::V2_EXTENSION(body) => body.ser(version, bytes),
37147 Self::VFR_HUD(body) => body.ser(version, bytes),
37148 Self::VIBRATION(body) => body.ser(version, bytes),
37149 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
37150 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
37151 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
37152 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
37153 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
37154 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
37155 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
37156 Self::WINCH_STATUS(body) => body.ser(version, bytes),
37157 Self::WIND_COV(body) => body.ser(version, bytes),
37158 }
37159 }
37160 fn extra_crc(id: u32) -> u8 {
37161 match id {
37162 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
37163 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
37164 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
37165 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
37166 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
37167 ARRAY_TEST_0_DATA::ID => ARRAY_TEST_0_DATA::EXTRA_CRC,
37168 ARRAY_TEST_1_DATA::ID => ARRAY_TEST_1_DATA::EXTRA_CRC,
37169 ARRAY_TEST_3_DATA::ID => ARRAY_TEST_3_DATA::EXTRA_CRC,
37170 ARRAY_TEST_4_DATA::ID => ARRAY_TEST_4_DATA::EXTRA_CRC,
37171 ARRAY_TEST_5_DATA::ID => ARRAY_TEST_5_DATA::EXTRA_CRC,
37172 ARRAY_TEST_6_DATA::ID => ARRAY_TEST_6_DATA::EXTRA_CRC,
37173 ARRAY_TEST_7_DATA::ID => ARRAY_TEST_7_DATA::EXTRA_CRC,
37174 ARRAY_TEST_8_DATA::ID => ARRAY_TEST_8_DATA::EXTRA_CRC,
37175 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
37176 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
37177 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
37178 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
37179 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
37180 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
37181 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
37182 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
37183 }
37184 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
37185 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
37186 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
37187 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
37188 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
37189 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
37190 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
37191 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
37192 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
37193 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
37194 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
37195 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
37196 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
37197 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
37198 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
37199 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
37200 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
37201 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
37202 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
37203 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
37204 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
37205 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
37206 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
37207 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
37208 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
37209 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
37210 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
37211 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
37212 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
37213 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
37214 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
37215 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
37216 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
37217 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
37218 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
37219 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
37220 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
37221 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
37222 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
37223 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
37224 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
37225 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
37226 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
37227 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
37228 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
37229 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
37230 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
37231 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
37232 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
37233 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
37234 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
37235 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
37236 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
37237 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
37238 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
37239 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
37240 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
37241 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
37242 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
37243 }
37244 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
37245 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
37246 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
37247 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
37248 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
37249 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
37250 }
37251 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
37252 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
37253 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
37254 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
37255 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
37256 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
37257 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
37258 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
37259 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
37260 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
37261 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
37262 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
37263 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
37264 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
37265 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
37266 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
37267 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
37268 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
37269 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
37270 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
37271 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
37272 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
37273 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
37274 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
37275 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
37276 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
37277 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
37278 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
37279 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
37280 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
37281 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
37282 }
37283 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
37284 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
37285 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
37286 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
37287 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
37288 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
37289 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
37290 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
37291 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
37292 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
37293 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
37294 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
37295 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
37296 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
37297 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
37298 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
37299 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
37300 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
37301 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
37302 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
37303 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
37304 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
37305 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
37306 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
37307 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
37308 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
37309 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
37310 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
37311 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
37312 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
37313 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
37314 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
37315 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
37316 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
37317 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
37318 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
37319 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
37320 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
37321 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
37322 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
37323 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
37324 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
37325 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
37326 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
37327 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
37328 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
37329 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
37330 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
37331 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
37332 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
37333 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
37334 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
37335 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
37336 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
37337 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
37338 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
37339 PING_DATA::ID => PING_DATA::EXTRA_CRC,
37340 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
37341 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
37342 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
37343 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
37344 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
37345 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
37346 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
37347 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
37348 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
37349 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
37350 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
37351 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
37352 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
37353 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
37354 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
37355 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
37356 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
37357 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
37358 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
37359 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
37360 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
37361 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
37362 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
37363 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
37364 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
37365 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
37366 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
37367 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
37368 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
37369 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
37370 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
37371 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
37372 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
37373 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
37374 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
37375 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
37376 }
37377 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
37378 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
37379 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
37380 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
37381 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
37382 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
37383 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
37384 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
37385 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
37386 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
37387 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
37388 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
37389 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
37390 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
37391 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
37392 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
37393 }
37394 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
37395 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
37396 }
37397 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
37398 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
37399 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
37400 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
37401 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
37402 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
37403 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
37404 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
37405 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
37406 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
37407 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
37408 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
37409 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
37410 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
37411 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
37412 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
37413 _ => 0,
37414 }
37415 }
37416 fn target_system_id(&self) -> Option<u8> {
37417 match self {
37418 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
37419 Self::CANFD_FRAME(inner) => Some(inner.target_system),
37420 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
37421 Self::CAN_FRAME(inner) => Some(inner.target_system),
37422 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
37423 Self::COMMAND_ACK(inner) => Some(inner.target_system),
37424 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
37425 Self::COMMAND_INT(inner) => Some(inner.target_system),
37426 Self::COMMAND_LONG(inner) => Some(inner.target_system),
37427 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
37428 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
37429 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
37430 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
37431 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
37432 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
37433 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
37434 Self::LOGGING_ACK(inner) => Some(inner.target_system),
37435 Self::LOGGING_DATA(inner) => Some(inner.target_system),
37436 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
37437 Self::LOG_ERASE(inner) => Some(inner.target_system),
37438 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
37439 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
37440 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
37441 Self::MISSION_ACK(inner) => Some(inner.target_system),
37442 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
37443 Self::MISSION_COUNT(inner) => Some(inner.target_system),
37444 Self::MISSION_ITEM(inner) => Some(inner.target_system),
37445 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
37446 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
37447 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
37448 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
37449 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
37450 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
37451 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
37452 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
37453 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
37454 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
37455 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
37456 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
37457 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
37458 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
37459 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
37460 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
37461 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
37462 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
37463 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
37464 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
37465 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
37466 Self::PARAM_SET(inner) => Some(inner.target_system),
37467 Self::PING(inner) => Some(inner.target_system),
37468 Self::PLAY_TUNE(inner) => Some(inner.target_system),
37469 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
37470 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
37471 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
37472 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
37473 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
37474 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
37475 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
37476 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
37477 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
37478 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
37479 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
37480 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
37481 Self::SET_MODE(inner) => Some(inner.target_system),
37482 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
37483 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
37484 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
37485 Self::TIMESYNC(inner) => Some(inner.target_system),
37486 Self::TUNNEL(inner) => Some(inner.target_system),
37487 Self::V2_EXTENSION(inner) => Some(inner.target_system),
37488 _ => None,
37489 }
37490 }
37491 fn target_component_id(&self) -> Option<u8> {
37492 match self {
37493 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
37494 Self::CANFD_FRAME(inner) => Some(inner.target_component),
37495 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
37496 Self::CAN_FRAME(inner) => Some(inner.target_component),
37497 Self::COMMAND_ACK(inner) => Some(inner.target_component),
37498 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
37499 Self::COMMAND_INT(inner) => Some(inner.target_component),
37500 Self::COMMAND_LONG(inner) => Some(inner.target_component),
37501 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
37502 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
37503 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
37504 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
37505 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
37506 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
37507 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
37508 Self::LOGGING_ACK(inner) => Some(inner.target_component),
37509 Self::LOGGING_DATA(inner) => Some(inner.target_component),
37510 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
37511 Self::LOG_ERASE(inner) => Some(inner.target_component),
37512 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
37513 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
37514 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
37515 Self::MISSION_ACK(inner) => Some(inner.target_component),
37516 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
37517 Self::MISSION_COUNT(inner) => Some(inner.target_component),
37518 Self::MISSION_ITEM(inner) => Some(inner.target_component),
37519 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
37520 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
37521 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
37522 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
37523 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
37524 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
37525 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
37526 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
37527 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
37528 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
37529 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
37530 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
37531 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
37532 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
37533 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
37534 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
37535 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
37536 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
37537 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
37538 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
37539 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
37540 Self::PARAM_SET(inner) => Some(inner.target_component),
37541 Self::PING(inner) => Some(inner.target_component),
37542 Self::PLAY_TUNE(inner) => Some(inner.target_component),
37543 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
37544 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
37545 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
37546 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
37547 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
37548 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
37549 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
37550 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
37551 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
37552 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
37553 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
37554 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
37555 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
37556 Self::TIMESYNC(inner) => Some(inner.target_component),
37557 Self::TUNNEL(inner) => Some(inner.target_component),
37558 Self::V2_EXTENSION(inner) => Some(inner.target_component),
37559 _ => None,
37560 }
37561 }
37562}